Object Role Modeling


Object Role Modeling (ORM) is a method to design database models at the conceptual level in terms of objects and roles. You can also apply business rules in the model.

ORM represents an application as a set of objects that play various roles in relationships. For example, an airlines application has two objects, airline and aircraft. These objects have one-to-many relationship. The roles of the two objects are, an airline has aircrafts and an aircraft belongs to the airline, respectively.

ORM is also called fact-based modeling because ORM verbalizes the relevant data as basic facts. For example, if an entity, employee, has a property, mobile number, this data is described as a fact.

Features of ORM

As compare to other modeling techniques, an ORM model:

  • Is easy to understand because it describes the states and roles of all the objects, along with the business rules in the model, in simple English.

  • Uses graphical notations to express business rules that are not supported in other modeling techniques.

  • Validates the business rules in simple English and populates facts with sample data. For example, in an ORM diagram, you can include sample data for a fact that XYZ employee has a mobile whose number is 123.

  • Is executable because it converts a conceptual model of the database into a logical database schema by mapping all the entities, relationships, and constraints in the conceptual model.

Figure 1-2 shows a sample ORM model for a college system:

click to expand: this figure shows an orm model for a college system that defines the roles of various objects and their relationships with the faculty.
Figure 1-2: ORM Model

Each oval represents an object and each box corresponds to a role. Each box is associated with a predicate that defines the role the object plays in a relationship. Each predicate associated with an object generates a fact. For example, Faculty works for Department and Department employs a Faculty. A business rule is included in an ORM diagram in the form of a constraint. An arrow-tipped bar over a role is a unique constraint, which indicates that each object plays that role only once in a relationship with the other object. For example, each Faculty has at most one Name. A dot on a role connector indicates that the role is mandatory. For example, each Faculty must have a Name and must work for a Department.

ORM with Visual Studio .NET

Microsoft Visio provides an ORM modeling tool. This tool automatically verbalizes the facts and business rules an ORM model defines. As a result, you can easily understand the facts and constraints by just looking at the model.

You can use the ORM modeling tool to map the UML model to the physical database schemas for implementation with .NET and other applications. The ORM model automatically generates a logical database model. You can use this model to generate SQL code, which represents the physical database schema and apply it to your selected database system.

You can also reverse engineer physical database schema into an ORM model. Changes made in the logical database model are automatically reflected in the ORM model and vice versa.




NET InstantCode. UML with Visio and Visual Studio .NET
NET InstantCode. UML with Visio and Visual Studio .NET
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 49

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net