Templates |
Top Previous Next |
A Template is simply an object that can be reused to define other objects. It defines the properties and objects that other objects can "inherit" - in effect allowing you to organize any type of object into classes with share properties. If an object doesn't have value for a property, ModelRight will look to see if the it's Template has a value for the property. You can think of Templates as a way to classify your objects based on the properties they have in common and then define those properties in one place - the Template. For example, you might have lots of Columns in your Model that are some type of ID (Customer ID, Employee ID, etc...). Instead of having to assign common properties to them individually (a datatype of INTEGER, NOT NULL, etc..), you could create a Template named ID, assign to it the common properties and then assign it to all of your ID Columns. That way you are assured consistency of those properties across all of your ID Columns and you can easily change their properties simply by changing the ID Template. So Templates effectively provide a way to classify your objects, organize their properties, enforce consistency of property values, and easily make changes across the class of objects. Of couse, you can add arbitrary level of Templates to suit your desired meta-data organization.e ModelRight always provides a "default" Template for any object that uses Templates. Thus give you a way to set Model-wide defaults for any property - JUST by setting it on the default Template. To see all the different types of Templates that ModelRight supports, click the How Templates WorkAn easy to visualize example is a An object "overrides" an inherited property when you modify that property on the object. So, if you again select a Diagram in the Diagrams section of the Model Explorer (or by navigating back Not only can a regular object inherit from a Template, but a Template can inherit from another Template. i.e. a Diagram Template can inherit from another Diagram Template. This allows you to create a classification scheme as a hierarchy of Templates with each level contributing more properties and effectively adding more specificity. Column GroupsModelRight 4.1 allows you to add Columns as children of a Column Template. Any Column that then "inherits" from it will also inherit these sub-Columns. This allows you to define a group of commonly used Column once and consistently reuse them throughout your Model. ![]() Column Domain Address is used to define sub-columns Street, City, Zip. ModelRight 4.1 also added a Column display option that lets you choose whether to view the Sub-Columns or the Top-Level Columns on the Diagram. This option is found under Content Display options for Columns. Table Template ColumnsYou can also add child Columns to a Table Template. Any table that then inherits from the Table Template will also contain those columns. For example, if you wanted every Table in your Model to contain a Create_Date and a Modify_Date Column. You could accomplish this by simply adding these Columns to the <default> Table Template. ![]() The <default> Table Domain with create_date and modiy_date sub-Columns. Table InheritanceA Table can now inherit from another Table as well as a Table Template. Inheritence relations are displayed on Diagram with an arrow Relation. All Columns and Table Check Constraints are inherited by the Table. ModelRight 4.1 also adds a corresponding Column display option that allows you to specify whether inherited Columns are displayed on the Diagram or not. This option is found under Content Display Options for Columns.
|