Re: HTML_DataGrid 0.1.0 ?

From: Date: Fri, 13 Feb 2004 13:08:40 +0000
Subject: Re: HTML_DataGrid 0.1.0 ?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25649@lists.php.net to get a copy of this message
Andrew Nagy schrieb:
I am starting to think that I have most of my conceptual ideas done for the DataGrid and would like to get more feedback. I would like to know how people feel about the package and if it is ready to be submitted to PEAR? Here are the remaining issues: - I would like to take a look at some other designs to compare to how the "Renderer" is setup in the my datagrid.
    The main problem is, I reference the renderer object in the datagrid
object and the renderer object references the datagrid object, so the data is duplicated!
    (Possibly a factory design could solve this?)
Mmmh, a factory design is never a bad idea, but I wonder why you think the data is being duplicated? If you've really used object references (by passing the variables via "function myFunc(&$myVar)" rather than "function myFunc($myVar)", and continue assigning by reference, no duplication should take place.
- I have created 2 additional record classes that extend the main record class to handle different data inputs (one for a db_dataobject and one for a db_result object).
    The problem with this is, it is a nice clean scalable design; however it
seems to be unncessary overhead and bloating. Since i have very little implemented with the record object itself, it needs to be looked over again
Well, if the classes don't contain much, then where's the bloat? You'd probably have to write more or less the same code into an ugly if- or switch-statement if you did it the non-OO-way; only that the code woul be less readable, less flexible and less maintainable (IMHO).
- The column "formatter" method needs to be finished, this method IMHO is very cool and solves many "customization" problems.
Yup, had something like this in my own approach, and it comes in quite handy. A possible alternative would be to use the command pattern approach, described here: http://www.phppatterns.com/index.php/article/articleview/96/1/1/
- The paging system is based on a records per page limit. I would like the paging system to be more flexible to allow alphabetical paging, as well as records per page.
A pager class which is plugged between the grid object and the renderer object comes to my mind here... in case you want other types of paging, well, just use another class... CU Markus

« previous php.pear.dev (#25649) next »