根据
Initial POCO Design 1-Pager
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?如果没有,很难看出实体框架如何被称为提供持久性无知.