Re: Question about reusing model entities
Re: Question about reusing model entities
- Subject: Re: Question about reusing model entities
- From: Chuck Hill <email@hidden>
- Date: Wed, 16 Jul 2008 12:09:29 -0700
On Jul 16, 2008, at 11:48 AM, Chris Meyer wrote:
I find myself reusing some entities in multiple applications. In
particular, many applications I'm writing have a user login model
with User, UserLog, and other entitities.
Right now for simplicity I'm just copying the EOModel entities and
Java subclasses to each new project, but this is quickly becoming a
burden to maintain between multiple projects.
Ick!
So it seems that the logical thing would be to put the common
entities and supporting classes into a framework.
Yes.
Does anyone have any recommendations about doing this?
Yes, do it. :-)
For instance, I'm a bit uncertain about cross model relationships,
which will be absolutely necessary for a fundamental entity such as
a user.
They work fine. Cross database relationships are a bit more dodgy.
And what about adding additional relationships specific to the
application to the User entity?
Name it GenericUser (or whatever) in the framework. Subclass
GenericUser as User in the app model and add whatever you need. Done.
How do other people re-use specific entities across different
projects?
They are generic, not specific, if projects need to extend them
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden