george,
 
this design issue should not be dependant on orion or any application server. orion can help becuase it supports ejb 1.1 and partially ejb 2.0. so there are a few options, you could write custom entites to manage the relationships, use ejb 1.1 or ejb 2.0. doing an ejb 2.0 implementation means you can model all the relationships in the ejb architecture, but be careful becaue i dont know how much of the ejb 2.0 specification orion supports.
 
for ejb 2.0, doing the Class, Group and User relationships is pretty straight forward, all are standard one-to-many relationships. you may just need one entity bean for the Class entity and have the others as helper classes, or Local ejbs, or have all three as entity beans.
Class    1-----*    Group
Group    1-----*    User
 
To do the roles, is seems like you want 3 relationships. your diagram shows the one to many relationship
Entity    1-----*    Role.
It seems like you want the opposite
Entity    *-----1    Role.
Or if you want the entity to be able to map to several different roles, you would want
Entity    *------*    Role.
 
So each Entity (Class, Group and User) has the relationship defined. You would not have an abstract entity. So you would have 3 relationships like
Class    *-------*    Role
Group    *-------*    Role
User      *-------*    Role
 
regards, simon
-----Original Message-----
From: George Mardale [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 8:29 AM
To: Orion-Interest
Cc: [EMAIL PROTECTED]
Subject: Design strategy

Hi everybody,
 
During our last application design, I have encountered the following issue and I don't know if Orion can handled it in a specific manner:
 
I have a hierarchy of users that consists of 3 levels: Class, Group, User. A class can contain one or more groups, a group can contain one or more users. For instance, an instance of Class can be "professor", an instance of Group can be "chemistry professor", and an instance of User can be "John" (John is a chemistry professor). We have 1..* relationship for each of the 3 levels. Of course, these are entity beans. Furthermore, we have another entity bean, called Role. The ideea is that every User can have a Role in an application  (for instance, John can be a SystemAdmin in an application), but also, a Group or a Class can have one or more Roles (instead of assigning a Role to every User in a Group or a Class, we assign the Role to the whole Group or Class, saving a lot of time this way, thus all the User in the respective Group or Class will have that Role). For all the Roles, we need to keep the id of the person(s) to whom the Role was assigned. But only at run-time I can find out the type of the component in the user hierarchy (either Class, Group, or User), to which the role has been assigned. In other words, an attribute in class Role has to store a value that is sometimes an instance of Class, sometimes an instance of Group and sometimes an instance of User.
 
Analyzing this issue, we came along with this diagram:
 
                        1        *
Abstract being    ---------- Role
            |  inherits
--------------------------
|            |            |
|            |            |
Class    Group    User
1 ------- *      1----- *
 
How can we achieve this in Orion? Is it possible?
 
Thank you for your time,
best regards,
George.
 

Reply via email to