Presents: ObjectRoleModeling.com Thursday, January 08, 2009
 Search
Register Login
Web Log
 
 
  Cloning and Reusing Model Elements in Visio  
 
Location: BlogsObjectRoleModeling.com Web LogVisio Tool Tips    
Posted by: Scot Becker 10/12/2004

Although Visio supports the standard cut-copy-paste operations found in most software, the results might not be what you expect because Visio separates the notion of the definition of a model element (e.g. a table, object type, predicate, whatever) from the shape(s) used to display that element. Continuing with the tool tips theme I have started, I thought I’d detail how Visio performs these operations.

The first operation to mention is that of cloning a model element. When you clone a model element (or group of elements) you are creating a new element (or group of elements) with the exact same properties as that (those) being cloned.

The traditional copy-paste operation performs a clone. Thus, if I select the object types and predicate of the fact "Person drives Car" and then perform a copy-paste (e.g. by using the edit menu or via Ctrl+C, Ctrl+V) a new fact type will be created. However, the related model elements (i.e. the object and fact types) of the clone are distinctly different from those of the initially selected fact type. For example, if I change a property (e.g. the name) on the clone, the initial element remains unchanged. Further, to avoid name overlaps, Visio will append a number (usually "1") to the cloned object types thereby giving a fact reading like "Person1 drives Car1".

Compare this to the notion of reusing a model element (or group of elements). If you use the Object Types window to repeatedly drag out an object type, new graphical instances of the object type will be created but all instances represent the same object type. For example, if you change the name on one of the instances, all instances will get updated with the new name.

Similar behavior will result if you use the Business Rules window to drag out multiple instances of the same object type or predicate.

Visio has a neat shortcut used to clone any shape: if you select the shape (or use the shift key to select multiple shapes) and then hold down the Ctrl key while you click and drag the selected shapes to a new location, the shape(s) will be cloned. Trust me, it is easier to perform than explain, and is quite handy when you want to less cluttered model diagram.

Finally, I’d like to mention that a cut-paste (as opposed to copy-paste, described above) operation is largely useless in a database model diagram. This is because this operation is essentially a delete-create: all references to the cut and pasted model element(s) will be removed.

For example, let’s say I have the facts "Person drives Car" and "Person has Phone Number" and I cut and paste the Person object type. The result is that the Person object type is removed from any facts that refer to it, the Person object type is deleted, and then the Person object type is re-created leaving both facts with no role player where Person used to be.

Likewise, if I cut and paste the entire fact "Person drives Car", the Person object gets removed from the second fact (Person has Phone Number), the selected object types and predicate (Person drives Car) are removed and re-created, and the second fact has no role player where Person used to be.

Not very useful, eh?

Although I used ORM concepts (i.e. object and fact types) to explain this behavior, it identical to what would happen in an ER Source Model or Database Model Diagram.

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