[Newbies] How does one decide which Class to use as a model?
andy.burnett at knowinnovation.com
Mon Aug 18 14:13:46 UTC 2008
Start with Object.
I usually create my own "Model" base class for my application
(subclass of Object). I have an application right now called Epic, so
I have an EpicModel. It makes a convenient home for shared
Don't fall into the trap of subclassing collections. You almost always
want your domain object to have a collection, not be a collection.
It has been rare in my applications to have domain models that are
subclasses of something already in the image. Honestly can't think of
it happening once (though I'm sure that it has).
The domain is one place where you can be really clean. You usually
don't have that luxury in the presentation, controller, persistence,
<FX: sound of new subclassed collection being quietly deleted! > ;-)
Thanks guys, that's very helpful. I shall follow your advice
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners