The situation is: Branches have departments, and each department of branch could have groups. And sometimes, groups could directly belong to branch but not department.
Suppose I have the following classes,
Class Branch ------------- int branchID String name Department[] dept Group[] group
Class Department ---------------- int deptID String deptName
Class Group ---------------- int groupID String groupName
How to set dept and group in branch table? Are these three classes could satisfy the situation?
Thanks for advise.
karl koch
Ranch Hand
Joined: May 25, 2001
Posts: 388
posted
0
what ORM tool are you using ? k
Loren Rosen
Ranch Hand
Joined: Feb 12, 2003
Posts: 156
posted
0
What's the real significance of the department/branch/group distinction? Do you need to store very different data for each? Are their lots of business rules regarding their behavior?
Grady Jamyson
Ranch Hand
Joined: Aug 04, 2002
Posts: 42
posted
0
I don't use any ORM tool. I just want to know how to map the classes to the relational tables.
Grady Jamyson
Ranch Hand
Joined: Aug 04, 2002
Posts: 42
posted
0
I think the distinction of the department/branch/group is not very obvious. Because they all have names, id ...etc. But their relationship is like a tree. For instance, branch has some departments, and departments have groups, and sometimes branch has groups.
And their bahaviors are not all the same, just like different employees in different departments don't have the same behaviors.
Loren Rosen
Ranch Hand
Joined: Feb 12, 2003
Posts: 156
posted
0
Here's the reason I ask: One approach is to just use a single class (and corresponding table), called, say, OrganizationalUnit. There could also be an OUType class, essentially an enumeration. Then label the OUs with their types, and enforce the requirements about fits where in the tree as business rules. One reason for doing it this way is that the rules may change over time.