What is Persistence Ignorance?

In Entity Framework, Persistence Ignorance is defined as (MSDN):

An object that does not contain any logic that is related to data storage.

In his book “Applying Domain Driven Design and Patterns”, Jimmy Nilsson (also refers it as POCOs) defines as:

…ordinary classes where you focus on the business problem at hand without adding stuff for infrastructure-related reasons. … The classes should focus on the business problem at hand. Nothing else should be in the classes in the Domain Model.

Persistence ignorance object, or POCO, looks like this (notice there is no any constructor or method in this class):

public partial class Task
    public int Id { get; set; }
    public string Title { get; set; }
    public string Note { get; set; }
    public DateTime DueDate { get; set; }
    public DateTime EndDate { get; set; }
    public int PriorityId { get; set; }
    public int StatusId { get; set; }
    public int ResponsibilityId { get; set; }

1 thought on “What is Persistence Ignorance?”

Leave a Reply to altaf Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s