Persistence Ignorance refers to being
able to allow the developer to write
and test domain objects in a way that
is entirely independent of fundamental
requirements and assumptions that may
be made by the infrastructure service
(in this case,the Entity Framework).
Such requirements / assumptions may
often include:
- The need to implement a specific interface (for e.g.,IPOCO)
- Inheritance from a base class
- Providing specific constructors
- Object Instantiation/Construction requirements – use a specific factory
for instance**- The need for metadata or mapping class or property Attributes
- The need to use specific relationship mechanisms
This amounts to being able to use
Plain Old CLR Objects (POCO) so that a
developer can author their domain
objects free of all assumptions and
requirements imposed by the framework.
Using this approach,once the domain
objects are ready to their
satisfaction,the developer can use
these classes with the Entity
Framework in order for relational
database access and persistence.
截至目前(CTP5),有没有办法使用参数化构造函数重建poco?如果没有,很难看出实体框架如何被称为提供持久性无知.
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。