• 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: How do I get EO's instantiated with dynamic class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get EO's instantiated with dynamic class?


  • Subject: Re: How do I get EO's instantiated with dynamic class?
  • From: Riccardo De Menna <email@hidden>
  • Date: Fri, 17 Aug 2007 18:48:15 +0200


Oh thank you Guido. I had used restricting qualifiers before in a horizontal inheritance setup when I needed non-abstract superclasses but I had not realized that in fact a single table inheritance was exactly what I was asking for. I used to skip over that kind of inheritance back when I read about it in the EOmodeler pdf cause it looked "messy" in Apples example context. Now it suddenly makes perfectly sense.
Not only... you also forced me to find out there was a contextual menu with cool shortcuts in entity modeler ;-)


On 17.08.2007, at 10:20, Kieran Kelleher wrote:
I prefer using the Strategy Design Pattern instead of inheritance whenever possible

About the strategy design pattern route suggested by Kieran... yes please... send me some links.. I'm eager to look into it. A sort of plugin scenario would also fit perfectly well and I would enjoy some new design patterns to feed on.


Thanks again to you both for the help provided,
Cheers,
Ric

On 17/ago/07, at 18:06, Guido Neitzer wrote:

On 17.08.2007, at 09:46, Riccardo De Menna wrote:

I'm perfectly fine with one single table holding domain info... I simply want to fetch from it and receive specific subclasses of the main "domain" class.

It's called "Single Table Inheritance".

Create "Domain" Entity, make it static. Have an attribute "topLevelDomain". Make a subclass of "Domain" with Single Table Inheritance (it's an option in Entity Modeler), call it ComDomain and set the qualifier to be "topLevelDomain = 'com'".

There you go. Whenever you query your database for "Domain" objects, all domains with topLevelDomain = 'com' come back as ComDomain objects.

You have one table and whatever number of Entities using it.

cug

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: How do I get EO's instantiated with dynamic class?
      • From: Kieran Kelleher <email@hidden>
References: 
 >How do I get EO's instantiated with dynamic class? (From: Riccardo De Menna <email@hidden>)
 >Re: How do I get EO's instantiated with dynamic class? (From: Guido Neitzer <email@hidden>)
 >Re: How do I get EO's instantiated with dynamic class? (From: Riccardo De Menna <email@hidden>)
 >Re: How do I get EO's instantiated with dynamic class? (From: Guido Neitzer <email@hidden>)

  • Prev by Date: Re: How do I get EO's instantiated with dynamic class?
  • Next by Date: Re: How do I get EO's instantiated with dynamic class?
  • Previous by thread: Re: How do I get EO's instantiated with dynamic class?
  • Next by thread: Re: How do I get EO's instantiated with dynamic class?
  • Index(es):
    • Date
    • Thread