RoccoC5
RoccoC5

Reputation: 4213

Business Entity contains persistence functionality

Is there a name for the pattern in which business objects contain their own persistence mechanism? For example:

public class Customer
{
    public string Name { get; set; }
    public int Id { get; set; }

    public void Save()
    {
        // save to database
    }
}

I'm not an advocate of this design - I'm just curious if there is a name for it.

Upvotes: 0

Views: 128

Answers (1)

amit_g
amit_g

Reputation: 31250

Active record pattern

Upvotes: 1

Related Questions