Re: Multiple EO classes inheriting from one abstract superclass?
Re: Multiple EO classes inheriting from one abstract superclass?
- Subject: Re: Multiple EO classes inheriting from one abstract superclass?
- From: Travis Britt <email@hidden>
- Date: Thu, 6 Aug 2009 17:49:04 -0400
On Aug 6, 2009, at 4:10 PM, Andrew R. Kinnie wrote:
I have four tables in a database, which are materialized views from
an oracle db. All four share 12 columns, which are basically
numerical values.
I have 4 components which display repetitions based on these four
tables. I have these inheriting from one abstract superclass
containing the calculations on the 12 values.
The problem is, Entity Modeler wants me to have a primary key for
the abstract eo superclass, but the 4 subclasses have different
primary keys representing different foreign keys from their source
tables. Some of these keys are multiple foreign keys from multiple
source tables (i.e. the eo is essentially a join)
I suggest these entities have some of the same things, but aren't the
same thing. At least so far as EOF is concerned. :)
Any ideas? It there a way to do this? Or do I need to write the
code 4 times in both the component and the eos?
What code are you writing four times? You mentioned you have code that
does the computation in a common component class? Depending on what
the code is there are lots of ways to avoid the duplication. You could
define an object that does all the work and then call on it from each
of the four EOs, so the code that does real work only exists once...
You could have each of those EOs implement an interface for those
columns. Then you'd write your component to work with objects that
implement that interface...
tb
_______________________________________________
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