What is so great about ORM?

后端 未结 4 1007
花落未央
花落未央 2021-02-15 10:39

So I\'m having a head against the wall moment and hoping somebody can come help either remove the wall or stop my head from moving!!

Over the last 3/4 weeks I\'ve been i

4条回答
  •  执笔经年
    2021-02-15 11:00

    ORM let's you:

    1. To map table rows to objects, that are the the workable pieces of object oriented programming.
    2. To automatically navigate through object relationships
    3. To easily add, edit and remove table rows
    4. To query the database in a more intuitive way as you don't have to think of joins (this one will depend on the ORM and the query method)
    5. To transparently handle L1 and L2 cache.

    All of the above would have to be handled by hand if you werent using ORM.

    PS: I agree to Dmitry as to the startup time of NHibernate (see question comments). Besides, did you try Fluent NHibernate? Fluent NHibernate is impressively easy. I couldn't believe my eyes when I first mapped a database. It's even easier than proprietary ORMs like DevExpress XPO.

提交回复
热议问题