Re: Subclassing and Reusable Components
Re: Subclassing and Reusable Components
- Subject: Re: Subclassing and Reusable Components
- From: Chuck Hill <email@hidden>
- Date: Mon, 25 Oct 2004 20:13:38 -0700
Hi Jamie,
At 09:07 PM 25/10/2004 -0400, Jaime Magiera wrote:
>So, I realize WO has a lot of potential for re-using classes and
>components. However, I haven't *really* taken advantage of that power
>yet. Now is the time to start :)
>
Relax, it is easy.
>I have a "Project" object. This object is sub-classed into
>"SoftwareProject", "MediaProject", etc.
>
Does that mean you are using EOF inheritance? Do "SoftwareProject" and
"MediaProject" have data and behavior that Project doesn't?
>The "Project" object has a
>"DiscussionThreads" key. I would also like the sub-classes to have
>"DiscussionThreads".
>
You mean they don't? Whoa! They should if you are using EOF inheritance.
At this point, I am not quite clear on where you are in this. Are you just
asking about design? Have you started to model this and run into problems?
>Question 1: What would be the best implementation of this? Right now, I
>have sub-classed DiscussionThread ("SoftwareDiscussionThread", etc.).
>However, that seems like maybe a long-winded approach. Is there a good
>way for each subclass to link to a single DiscussionThread table?
>
Why did you subclass them? Do they have data and behavior that
DiscussionThread does not? Otherwise, there is no reason for them to be
subclasses. Either way, why do you feel they could not / would not easily
link to a single table?
>Question 2: If I want to create a single component for viewing the
>DiscussionThreads, how can I accommodate each sub-class.
The answer to that depends on what is different / what you want to be
different in each sub-class. WOSwitchComponent can also be used to switch
UIs on the fly.
>I'm assuming a
>combination of EOEnterpriseObject and "valueForKey". Am I on the right
>track?
>
I don't know. Without some more details I am not even sure where you are
heading. :-)
Chuck
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.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