Re: Tweaking the model on start-up
Re: Tweaking the model on start-up
- Subject: Re: Tweaking the model on start-up
- From: Paul Hoadley <email@hidden>
- Date: Sat, 04 Jun 2016 08:39:22 +0930
Hi Mark,
Is there a convenient way to update an Entity details when the app starts up?
e.g. 'Model Framework’ (A) has an Entity called ‘User’ ‘Model Framework’ (B) has an Entity called ‘Hub’ that is joined (to-one) with to ‘User’ i.e. com.B.Hub —> com.A.User (where ‘User’ knows nothing about ‘Hub’, it is out of scope)
I can create a class in (B) called com.B.User extends com.A.User
At the risk of being that guy on the list who doesn’t answer your specific question, but veers off to discuss a semi-related topic, have you considered using partial entities?
If User was your framework-level base entity, and you needed a domain-specific User-like entity in another context, you could create com.B.BUser as a partial entity on com.A.User, adding the to-many relationship com.B.BUser.hubs right there in the model. The only obvious caveat here is that you describe B as a “Model Framework” as well, in which case you couldn’t have any _further_ specialisation of User via partial entities (as a partial entity cannot augment another partial) if you needed something more at the application level.
In any case, if this pattern fits, we’ve been using partial entities for years. The package is completely stable.
|
_______________________________________________
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