• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tweaking the model on start-up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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,

On 3 Jun 2016, at 5:44 AM, Mark Gowdy <email@hidden> wrote:

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?

https://jenkins.wocommunity.org/job/Wonder7/lastSuccessfulBuild/javadoc/er/extensions/partials/package-summary.html

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.


-- 
Paul Hoadley
http://logicsquad.net/



 _______________________________________________
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

References: 
 >Tweaking the model on start-up (From: Mark Gowdy <email@hidden>)

  • Prev by Date: Re: Tweaking the model on start-up
  • Next by Date: Re: New RPM package for the woadaptor for Apache 2.4
  • Previous by thread: Re: Tweaking the model on start-up
  • Next by thread: How to avoid expensive fetches in database when setting to-one-relationship
  • Index(es):
    • Date
    • Thread