Does anybody have an opinion on using App::import for an abstract base
class before defining the concrete sub-class? It seems like a way to
avoid including all abstract parents before creating a concrete
instance... but it violates good OO practices it seems? Do people have
an opinion on this?

Outside of cake, I'd probably group these classes in the same file, or
perhaps group the abstract classes in one file and leaves in
another... to avoid unnecessary includes.

Example (with a composite pattern where Unit and UnitComposite are
abstract and Army extends UnitComposite which extends Unit):

App::import('Component', 'Unit');
App::import('Component', 'UnitComposite');

class ArmyComponent extends UnitComposite...
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to