How does one decide which Class to use as a model?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How does one decide which Class to use as a model?

Andy Burnett

<<David Mitchell-10

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
functionality.

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,
etc. >>


<FX: sound of new subclassed collection being quietly deleted! > ;-)

Thanks guys, that's very helpful.  I shall follow your advice

Cheers
AB

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners