locked
What is advantage of ORM and Entity framework RRS feed

  • Question

  • User264732274 posted

    apologized to put here so basic question

    please some one help me to understand what is ORM and its advantage ?

    after that tell me the advantage of Entity framework as ORM

    thanks

    Monday, September 7, 2015 5:46 AM

Answers

All replies

  • User1724605321 posted

    Hi sudip_inn ,

    please some one help me to understand what is ORM and its advantage ?

    Object-relational mapping, in the purest sense, is a programming technique that supports the conversion of incompatible types in object-oriented programming languages, specifically between a data store and programming objects. For the detail explanation and benefits you could refer to links below:

    http://blogs.learnnowonline.com/2012/08/28/4-benefits-of-object-relational-mapping-orm/ .

    http://stackoverflow.com/questions/398134/what-are-the-advantages-of-using-an-orm .

    after that tell me the advantage of Entity framework as ORM

    Entity Framework is highly recommended technology to build any complex system. Entity Framework is more powerful then ADO.NET and LINQ to SQL. Object Relational Mapping (ORM) is main technology that Entity Framework is used.  You could refer to links below for details:

    http://www.dotnetspan.com/2014/07/advantage-of-entity-framework.html .

    https://social.msdn.microsoft.com/Forums/en-US/16f4db07-2b8a-42fe-94a4-924b6916984d/ .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 7, 2015 5:59 AM
  • User-1923420989 posted
    ORM - Object relational mapping facilitates our objects to interact with our databases for all sort of CRUP operations.

    All the database tables are represented here as Objects and access those objects by querying it (thru LINQ for ex.)

    ORM is generic term where microsoft implement its own way as "Entity Framework"

    Find the list of advantages and disadvantages http://www.findbestopensource.com/article-detail/orm-advantage-disadvantage

    the comparison between two different ORMs http://www.infoq.com/news/2012/06/NHibernate-EF
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 7, 2015 6:08 AM
  • User264732274 posted

    why do u think Entity Framework is more powerful then ADO.NET ?

    would give some example which describe it. thanks

    Monday, September 7, 2015 6:41 AM
  • User-821857111 posted

    There are two ways in which you can work with data in a .NET application. One is in the form of DataReaders and DataTables (ADO.NET) and the other is in the form of your own classes (or objects) (e.g. a Product class, a Customer class, an Order class etc). When you access data in a DataReader or DataTable, you normally do so via the numeric index of the item (rdr[0].ToString() or dt.Rows[0].Columns[3]) or a string-based index (rdr["OrderId"] etc). This approach is error prone. If someone adds an extra field to the SELECT clause, the indexes can get thrown out. Typos in string-based accessors will lead to runtime errors. When you program with objects, you get Intellisense help. The compiler will tell you if you are trying to access a property that doesn't exist.

    It takes a lot of code to transfer data from DataReaders to objects, and to transfer objects back to data that needs to be saved into a database. You have to write it and maintain it. Or, you can use an ORM that does all that for you - including generating the required SQL.

    Monday, September 7, 2015 11:08 AM