Presents: ObjectRoleModeling.com Tuesday, January 06, 2009
 Search
Register Login
Forums
 
 

Note: To post to a thread, you must be logged in.

  Forums  
 
SearchForum Home
     
  Object-Role Modeling  General Discussion  UC's and ternar...
 UC's and ternary roles
 
imgOfflineulrikrasmussen
2 posts
Joined
12/11/2006

UC's and ternary roles
Posted: 11 Dec 06 1:19 AM
Hello!

I'm modeling an ORM for a database I'm designing. I'm a little new to ORM, so I have some questions about a specific case I'm trying to describe. Here it goes:

A USER can occupy a RESOURCE during a TIMESPAN.
A USER will be able to occupy any number of RESOURCES during many TIMESPANS.
However, a RESOURCE of course can't be occupied twice at the same TIMESPAN, and can't be occupied by more than one USER at a time (at least not in this specific case).

To model this, I'm thinking something like this:

A ternary role, with a UC spanning all three objects (USER, RESOURCE and TIMESPAN) to ensure that a relation between these are unique.
Then a UC spanning RESOURCE and TIMESPAN only.

Do you think that would be adequate? Thanks!
imgOfflineScot Becker
223 posts
www.orthogonalsoftware.com
4th
Joined
9/24/2004

Re: UC's and ternary roles
Posted: 11 Dec 06 8:55 AM Modified By Scot Becker  on 12/11/2006 8:56:08 AM)
You don't actually need the spanning UC as it is implied by the stronger constraint spanning Resource and Timespan.

You have other options for modeling this, see this: http://www.objectrolemodeling.com/WebLog/tabid/58/EntryId/33/Default.aspx

Also, keep in mind that you will need to adjust Timespan for implementation, usually by using a couple of dates, and this will change the UCs. For example, see this: http://www.objectrolemodeling.com/WebLog/tabid/58/EntryId/35/Default.aspx

Hope that helps,
Scot.
imgOfflineulrikrasmussen
2 posts
Joined
12/11/2006

Re: UC's and ternary roles
Posted: 11 Dec 06 10:05 AM
Hello Scot,

I can see now that the spanning UC was redundant, thanks for the heads up :). I found it much easier to model my needs when creating a list of sample roles, and marking the unique constraints with either bold/colored/underlined decoration. Thanks for your articles, they seem to have some good in-depth samples of how to model this too.

I now changed my role to the following:
I still have a Resource, a Timespan and a User, but now
   a UC spans Resource and Timespan, and
   a UC spans Timespan and User.

This should constrain the resources to only be occupied in a single timespan (provided these don't overlap of course), and a user to only occupy a resource during a timespan (makes sense in the context of the application).

I think I get a little confused when modeling all this information into something as compact as a ORM role, but I think I've got the hang of it now :).

Thanks for your help,
Ulrik
  Object-Role Modeling  General Discussion  UC's and ternar...
 
  Syndication  
   
 
© 2003 - 2009 Orthogonal Software Corporation. All rights reserved. Terms Of Use Privacy Statement