开发者

Business Entity contains persistence functionality

Is there a name for the pattern in which business objects contain their own persistence mechanis开发者_如何学Pythonm? 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.


Active record pattern

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜