Lightweight alternatives to NHibernate

后端 未结 8 1889
感情败类
感情败类 2021-01-01 17:54

NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.)

Is there a good lightweight alternative?

Support

相关标签:
8条回答
  • 2021-01-01 18:18

    Generally speaking, for your database backend to work with .net you need an ADO.Net provider for it.

    For MS Access (Jet), the Provider is shipped with .net. For SQLite, there is a selfcontained ADO.Net Provider.

    As for the data access layer lib, if you want some abstraction over ADO.Net:

    • MS Data Access Application Block, a part of ms enterprise library.
    • iBatis.Net (Was retired by the Apache Foundation in 2010) MyBatis.net
    • ADOTemplate from the Spring Framework.net

    All those work well starting with framework 2.0 and up.

    Basically, you choose (and there is a lot of choices)

    0 讨论(0)
  • 2021-01-01 18:23

    Here's a big list of alternatives, ones I'd recommend:

    • Coolstorage
    • SOODA
    • ODX
    • Lightspeed (free for 8 objects or less)

    Those 4 are the lightest ones. Subsonic, ActiveRecord and others are aimed at large systems. They work fine on smaller systems but (atleast for ActiveRecord) come with a huge list of dependencies and overkill for a small system. I'd go with Lightspeed and say anything under 8 objects is a small system, and simply using NHibernate because it's widely adopted is good for scaling but in the short term makes no sense - and having a layer between the ORM and your consumers can work around that anyway.

    0 讨论(0)
提交回复
热议问题