• 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: Kieran Kelleher <email@hidden>
  • Date: Fri, 17 Aug 2007 12:20:10 -0400

I prefer using the Strategy Design Pattern instead of inheritance whenever possible ...... using the Strategy Design Pattern will result in one Domain entity and the internal logic/behaviours can be implemented by a single interface or multiple interfaces allowing you a flexible logic building block architecture. Inheritance is fine, but it is all too commonly used and ends up painting one into a corner.

If you need more pointers on how you would implement Strategy design pattern in an easy to maintain way for an enterprise object let me know.

Regards, Kieran

On Aug 17, 2007, at 11:46 AM, Riccardo De Menna wrote:

Hi Guido,

I might have badly explained my issue. I have successfully used EO inheritance in another context, but my aim here is exactly the opposite. I don't want to model my DB with all sort of empty tables for every possible domain ending (there are more than 200 different country codes and such).
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. These would simply differ from the common superclass in the custom logic in them and NOT in the fields they hold. Let's say for example that the DotCOM domain subclass would validate domains up to 63 chars in length while the DotEU would start bitching for anything longer than 25 or so, even though the table holds any length.
That said I'm ordering Chuck's book anyway but it will take some time to get my hands on it since I'm traveling through Europe atm.
If someone could simply tell me "you can't do it" or "you do it by subclassing this" or such it would speed me up a lot...


Cheers,
Ric

_______________________________________________ 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: Guido Neitzer <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>)

  • 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