Hi Paul, Thank you for your help. I did suspect that partial entities would only work with a single table, but that was just a guess since the html document and the example implement the partials in a single table. I think I understood the concept, but tried to make it work in a way it wasn't supposed to. The example is very well built and shows very well how to use partials.
BTW, does it make sense to have Partials from different tables as I tried? For cases like the model I am trying to design it would make sense, where an entity can be one or other depending on the context, but their contents are so different that a single table solution would have too many null values. Partials joining two tables would solve my problem. I am indeed working with a toy application, in an effort to deepen my understand of Wonder. I am testing several architectural, modeling and implementation options before I start my full application development. That's where ERPartials enter, in an attempt to solve the model I explained. Thanx, Ângelo 2014-05-13 19:24 GMT-03:00 Paul Hoadley <[email protected]>: > Hi Angelo, > > On 14/05/2014, at 4:08 AM, Ângelo Andrade Cirino <[email protected]> > wrote: > > > I am trying to model a ContactMechanism entity with three specialized > entities representing Phone, Email and PostalAddress. I followed the > ERPartial documentation and example and thought that I would be able to > model composition instead of inheritance using ERPartials. Since the three > specialized entities are very different from each other, each one has its > own table. > > This is going to be a show-stopper. Partial entities work with a single > table. > > > It seems that I didn't grasp how to use partials. Any suggestions or > should I rely on inheritance instead? > > Personally I'm not a big fan of inheritance (in EOModels), especially > across models, which is the use case that partial entities was originally > developed to help with. (The classic example, as described in the > package-level Javadocs, being a "Person" entity in a reusable framework, > and application level specialisations of that entity for the project at > hand.) I don't know whether partial entities will be a good fit for the > case you describe above, but I can assure you that they do work. I would > suggest that firstly you go over the example in Examples/ERXPartials (again > if you've already done so!), and secondly create you own toy application > using partial entities to see how it all works. Well worth the time > investment, even if you don't end up using them. > > > -- > Paul Hoadley > http://logicsquad.net/ > > > > 2014-05-13 19:24 GMT-03:00 Paul Hoadley <[email protected]>: > Hi Angelo, > > On 14/05/2014, at 4:08 AM, Ângelo Andrade Cirino <[email protected]> > wrote: > > > I am trying to model a ContactMechanism entity with three specialized > entities representing Phone, Email and PostalAddress. I followed the > ERPartial documentation and example and thought that I would be able to > model composition instead of inheritance using ERPartials. Since the three > specialized entities are very different from each other, each one has its > own table. > > This is going to be a show-stopper. Partial entities work with a single > table. > > > It seems that I didn't grasp how to use partials. Any suggestions or > should I rely on inheritance instead? > > Personally I'm not a big fan of inheritance (in EOModels), especially > across models, which is the use case that partial entities was originally > developed to help with. (The classic example, as described in the > package-level Javadocs, being a "Person" entity in a reusable framework, > and application level specialisations of that entity for the project at > hand.) I don't know whether partial entities will be a good fit for the > case you describe above, but I can assure you that they do work. I would > suggest that firstly you go over the example in Examples/ERXPartials (again > if you've already done so!), and secondly create you own toy application > using partial entities to see how it all works. Well worth the time > investment, even if you don't end up using them. > > > -- > Paul Hoadley > http://logicsquad.net/ > > > >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
