What exactly is “persistence ignorance”?

后端 未结 8 2129
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 05:01

Persistence ignorance is typically defined as the ability to persist & retrieve standard .NET objects (or POCOs if you really insist on giving them a name). And a seemin

相关标签:
8条回答
  • 2020-12-01 06:02

    you can implement persisrtence ignorance using a class for the domain or you application and a POCO class in the persistence, when you are going to persist the domain object map it into your persistence class and use the persistence object to store with nhibernate o other framework

    your domain class must to ignore how is persisted the information, so you must no include any rules of a persistence framework like (empty constructor, virtual properties etc.)

    these persistence framework rules can be in your persistence class.

    0 讨论(0)
  • 2020-12-01 06:04

    While there may be certain minor constraints that any given persistence-ignorance framework requires, persistence-ignorance nevertheless remains in place.

    While a class in your domain model (transparently persisted with NHibernate) must have a no-arguments constructor so that it can be constructed "dynamically," it is not required to have a certain base class dictated by the framework nor is it required to have or override certain framework-specified methods.

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