Presents: ObjectRoleModeling.com Thursday, January 08, 2009
 Search
Register Login
Web Log
 
 
  More on reference modes, surrogate keys, and nested objects  
 
Location: BlogsObjectRoleModeling.com Web LogORM Primers    
Posted by: Scot Becker 3/4/2004

John Miller brought something to my attention the other day.... In VEA, you can define an internal reference mode for a nested object type. By definition, the reference mode of a nested object type is a composite of the reference modes of the objects that play roles in the fact that is nested to create the nested object type (that’s a mouthful!). (For more on nested object types and their reference modes, see this.)

After you create the nested object type via the fact editor, go to the Object Types tab of the Business Rules window and find your nested object. From that window, you can now specify a reference mode and a data type for that nested object. The diagram will even use the normal parenthesis in the object name to denote the reference mode and the object will generate as a table with a primary key of the reference mode and datatype you selected. As expected, the natural reference mode will generate as a unique key for that table.

Defining such an internal reference mode for a nested object type could be used to create a surrogate key for that object type. (For more on surrogate keys, see this.)

Notice, however, that the reference mode box is grayed out on the Reference Mode tab of the Database Properties window. Thus, I think this is an unintentional feature of VEA (but I wouldn’t call it a bug per se as it might be useful) and is likely the byproduct of class inheritance in the internals of the code. John says there was an analogous way to do this in VEAs predecessor, VisioModeler (nee InfoModeler), as well. I’m lazy and didn’t investigate this, but I’ll take his word for it.

Whether or not you would use this feature is a matter of style, I suppose. I like explicit facts for surrogate keys so you can call attention to the fact that you have added these "unnatural facts".

Permalink |  Trackback
 

Note: To comment on a blog post, you must be logged in.

  Search Web Log  
 
 
  Categories  
   
  Archive  
   
  Blog Roll  
   
  Syndication  
   
 
© 2003 - 2009 Orthogonal Software Corporation. All rights reserved. Terms Of Use Privacy Statement