Hi Chuck,

Thanks for your input and I hope it will help me understand the EOF 
relationship modelling better. Comments below:

On 2010-11-07, at 8:35 PM, Chuck Hill wrote:

> On Nov 6, 2010, at 11:02 PM, Farrukh Ijaz wrote:
> 
>>> For your case, I'm finding it difficult to imagine why two entities
>>> (IS-A) have such different relationship requirements.
>> 
>> The model has a legacy. In the beginning the entities appear to be different 
>> but semantically they are have some common behaviour when observed under 
>> specific domain . E.g. in a File System we have File and Folder (Directory) 
>> two separate entities. But at OS level, both have name, timestamp, 
>> permissions etc. The need before was to treat File and Folder as separate 
>> entities, but now the requirement demands to have some granularity among 
>> them. This is just an example to explain the situation.
> 
> 
> But do they share behavior?  Shared data is not necessarily an indication for 
> inheritance.

I can't answer this with 100% accuracy. But let me try to explain the model 
using Unix file system so it could become clear whether they share behaviour or 
not.

In Unix (or Linux) I can create directories (Entity A), and files (Entity B). 
Directories can have subdirectories and files (Entity A -> toMany Entity A and 
Entity A -> toMany Entity B). Now I have a requirement where I need to have a 
special type of directory (Entity C) which can have symlinks (Entity D) or 
subdirectories of  it's own type (Entity C) which means Entity C -> toMany 
Entity C and Entity C -> toMany Entity D. Each symlink can only point to 
directory, file, special directory or another symlink (which means Entity D -> 
toOne Entity A or toOne Entity B or toOne Entity C or toOne Entity D).

In this situation, if need an abstraction (either based on java based interface 
or EOF inheritance) which could treat all Entity A, Entity B, Entity C and 
Entity D such as Entity Alpha so I could have only 1 toOne relationship from 
Entity D to Entity Alpha.

My assumption is, if I implement a Java interface instead of EOF inheritance, 
EOF won't help much and I need to manage this relationship programmatically, 
right?

If the explanation is still confusing then I would opt for four toOne 
relationships from Entity D -> Entity A, Entity B, Entity C and Entity D. 
Assign all of them an interface to collect common data provide additional 
method to return a common object (by inspecting all of the four relationships 
as only 1 will be present at a time).

Farrukh _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to