Saturday, 11 July 2015

What is Object Relatinal Mapping (ORM)?

ORM- Object Relational Mapping 

What is ORM?
           ORM- Object relational mapping, is a technique which provide a platform in which developer can communicate with database. Means ORM helps to manipulate and access an incompatible object types to Object oriented programing languages, mainly with data source. The main feature of ORM is mapping, which map the relation between set object and relational data bases.

ORM provides separation of concern design principle in well designed application, means must of the  ORM tools rely on metadata about both the database and objects, so that the objects  do not need to know anything about the database and the database doesn’t need to know anything about how the data is structured in the application. This lets developer to maintain abstraction level.

ORM has many pros and cons. 

Pros:
  1. Productivity High : Data base operation is main part of any application and the time need to write this operation code is also the main part of development. In this case ORM tools helps to generate code of data access automatically based on the data model we defined.
  2. Business Rule : A good ORM tool designed by very experienced software architects will implement effective design patterns that almost force you to use good programming practices in an application. This can help support a clean separation of concerns and independent development that allows parallel, simultaneous development of application layers.
  3. Code re-usability : If you create a class library to generate a separate DLL for the ORM-generated data access code, you can easily reuse the data objects in a variety of applications. This way, each of the applications that use the class library need have no data access code at all. 
  4. Generating boilerplate code: Automatic code for basic CRUD operations (Create, Read, Update, Delete). Some ORM frameworks can inspect database metadata directly, read metadata mapping files, or use declarative class properties.

Cons:
  1. Performance: It is very likely that the data access code generated by the ORM is more complex than you’d typically write for an application. This is because most ORMs are designed to handle a wide variety of data-use scenarios, far more than any single application is ever likely to use. Complex code generally means slower performance, but a well-designed ORM is likely to generate well-tuned code that minimizes the performance impact.
Types of .net ORM:
Refer:
Types of .Net ORM

Continue...




No comments:

Post a Comment

Dotnet core Basic: Read appsettings value in application

How appsettings.json object is referenced into dotnet core application, with an example. Example: let say I have the functionality to downlo...