Lightspeed vs NHibernate

后端 未结 6 1882
鱼传尺愫
鱼传尺愫 2021-02-05 16:51

What is the experience with LightSpeed? The comparison provided by Mindscape doesn\'t say too much about NHibernate. Lightspeed seems flexible, but I don\'t see much about per

6条回答
  •  误落风尘
    2021-02-05 17:46

    Over the past six months, I've been using NHibernate with Active Record at work, and LightSpeed at home in my spare time.

    Advantages / Drawbacks So far, I've found both LightSpeed and NHibernate with Active Record to be straightforward to learn.

    I haven't found drawbacks with LightSpeed (yet). The features I like most are:

    • Convention over configuration. This saves a lot of time and provides consistent code.
    • The model class and config generator.
    • Support for Linq and MySQL 5.

    The features I like most about Active Record are:

    • No XML configuration required, the most common configuration options are provided automatically.
    • NHibernate's flexibility is still available when required (e.g. criteria queries).

    The drawbacks of Active Record for me are:

    • There appear to be more Ruby on Rails code examples than C# examples

    Performance I haven't (yet) compared both products side by side and run performance tests on both equally.

    I would guess that NHibernate suffers from a deeper class hierarchy. While optimising my code using ANTS Profiler, I found that for a simple query there is call after call through NHibernate classes before the actual SQL query is produced.

    Of course, it's the query that is produced that will make all the difference to the ultimate performance of the ORM.

    Both LightSpeed and NHibernate offer lazy loading, and Active Record makes this easy for NHibernate.

    I think it is easier to optimise your queries using Lightspeed with Linq, and more clear to people maintaining your code. Whereas it's not usually recommended to write NHibernate HQL.

提交回复
热议问题