Timeline for Object Paradigm for PHP, Practice in Design
Current License: CC BY-SA 2.5
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 14, 2011 at 20:19 | comment | added | 65Fbef05 |
Granted, it's the longest of the functions, but createDailyOrdersReport() is 147 lines. If I wanted to place this function in a createDailyOrdersReport class and combine the above classes into one, how would I go about extending/strapping my new class to the other?
|
|
Feb 14, 2011 at 19:40 | comment | added | eykanal | I would venture that this depends on the complexity of the "different behavior". If its just a few small changes, then go ahead and put each in its own function. If each is drastically different, I would combine the two current classes into the base class, and subclass each report type. | |
Feb 14, 2011 at 19:23 | comment | added | 65Fbef05 |
createDailyOrdersReport() and createDailyVolumeReport() , etc... will contain different behavior (I just left out that behavior for sake of brevity). Should this class be rewritten to exclude the actual report creation, bringing that functionality into a subclass? If so, I think I would have to duplicate the decision/execution logic before instantiation.
|
|
Feb 14, 2011 at 19:14 | history | answered | eykanal | CC BY-SA 2.5 |