These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Will this approach work?
PostPosted: Sun Sep 18, 2005 5:23 pm 
Newbie

Joined: Sun Apr 24, 2005 11:43 pm
Posts: 8
I have a class BaseEntity which has (for all intents and purposes here) just a GUID as a primary key, and an aggregation relationship with a class BaseRole. All roles in my framework are ultimately a specialization of BaseRole. More specifically each entity is really just several different roles with the same GUID. This is an implementation of the "Role-Relationship" approach seen Fowler's paper titled "Dealing with Roles". There are many "value" class dependencies that will key off of the GUID too. For instance there should only be one PersonDetail class for someone who is an (e.g. has the roles) Contractor, Driver, HumanResource, and LegalParty. To do this all value classes will key off the GUID as well.

Here's an example.

Code:
_____________             __________________
| BaseEntity | 1        * |     BaseRole    |
|------------|<>----------|-----------------|
|+GUID       |            |+roleName:String |
|------------|            |-----------------|
|____________|            |_________________|
                                 /\
                                /  \
                                ``|`
                                  |
     ______________               |
     |PersonDetail|        _______|________
     |------------|        | HumanResource |
     |+name       |<-------|_______________|
     |+ssn        |        |etc...
     |+address    |
     |etc...      |


In this application there are several entities that have several different roles in the system. Without looking at the database this model looks and works fine in code. I fear that problems might arise WRT concurrency seeing that I have one table that has the GUID for nearly every single object in the system. BaseEntity's table will not be updated very frequently, it will be read an order of magnitude more often than updated.

Imagine that there is an exhaustive hierarchy of roles and value classes beneath BaseRole. A good example of this would be Chris Marshall's approach in chapter 4 of "Enterprise Modeling with UML".

Will the SQL that hibernate generates cause me problems using this approach?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.