What is Orm?
Object-Role Modeling (ORM) provides a conceptual and easy-to-understand Method for modeling data. The ORM methodology is based on three core principles:
- Simple:Data is modeled in the most basic form.
- Communication:The database structure is documented in a language that anyone can understand.
- Accuracy:Create a correctly standardized structure based on the data model.
Typically, modelers collect data from familiar applicationsProgramHowever, people who are not skilled in Data Modeling develop information models. Modelers must be able to communicate with data structures at the conceptual level with terms that non-technical enterprise experts can understand. Modelers must also be able to process sample data with simple unit analysis information. Orm is specially designed to improve this connection.
Rule expression
Orm represents the application world as a group of objects (entities or values) with roles (LINKS ). Orm is also known as fact-based modeling because it describes relevant data as basic facts. If these facts are separated into smaller ones, information will be lost.
Examples of simple facts include:
- People have phone
- People live somewhere
- Life on a certain date
- A person is hired on a certain date
The corresponding ORM model of these facts is as follows:
Figure 1. Object Role Model
The circle in the figure represents the object, and the rectangle represents the argument. In an Orm, like in logic, a single argument is just a statement with an object hole. Arrows and points represent constraints in the system.
For example, the arrow in the diagnosis of "people have a phone number" can be translated as: Maybe someone has more than one phone number, and at least one person has a phone number.
In the fact that "Life on a certain date", the combination of the arrows on the argument and the connected object and the vertices shows that each person is born on a specific date.
Comparison with ER
Entity Relationship (ER) is another type of database modeling. Comparison between the simplicity of the ORM model and ER:
Figure 2. Object relationship
Orm describes enterprise facts in the form of simple objects and arguments, while the entity-link methodology describes the world with the term entity (having attributes and participating relationships. In the orm example in Figure 1, people, phone numbers, addresses, and dates are all represented as objects that assume interrelated roles. In the ER example, a person is an entity which is described by attributes: address and phone number.
For example, if you want to break down an address into a street, city, state, or zip code, you must change the address to an object type with corresponding attributes. The result will change the relationship between people and addresses. Although the constraints in the above ORM model can also be expressed in ER, you only need to add nodes to the model or write applications.CodeSupplement the model to indicate other constraints.
Advantages of ORM
Orm not only provides a simple and direct way to describe the relationship between different objects. From the example, we can see that ORM also provides flexibility. Models created Using ORM are more capable of adapting to system changes than models created using other methods. In addition, Orm allows non-technical enterprise experts to talk about models based on sample data, so they can use real-world data verification models. Because ORM allows reuse of objects, the data model can be automatically mapped to a correctly standardized database structure.
The simplicity of the ORM model simplifies the database query process. With the ORM query tool, you can access the expected data without understanding the underlying structure of the database.
Database generation and traversal
Like all good model methods, Orm is not just a concept. It contains different design processes to help modelers map conceptual and logical models, or convert between these models using conversion leads.
The ORM model can also be automatically mapped to the database structure implemented by most popular relational databases. Check the previous example. The ORM model can automatically generate an ER chart or logic model (which can be translated into SQL code and applicable to the selected database ).
Summary
Leveraging the knowledge of non-technical enterprise experts is important to ensure that applications meet enterprise needs. Orm, a feature of Visual Studio. NET, is an initial and easy-to-use conceptual data model method. By using a language that is not only understood by database experts, Orm enables those who fully understand the enterprise's needs for applications to directly participate in the design.
Orm also supports full traversal of cited charts. Therefore, once enterprise requirements are defined, they can be quickly converted into logical and physical database charts. With Orm, organizations can improve the efficiency of application development and ensure that enterprise needs can be delivered correctly.