Is there a design pattern for custom object and a object manipulator?

Viewed 57

We defined a class:

class Status {
    int id;
    string name;
    int progress;
    ...
}

This class is used in some places to represent the object(instance) of the status fields.

But, we also need to use this class to hold fields which need to be persisted to the database. So I plan to create another class:

class StatusUpdater() {
    Status m_status;
    DatabaseClient m_client;
    ...
}

I think maybe the method above is fine. But just wondering if there is a better way to do it? Is there a design pattern for defined objects and its updater(manipulator)?

0 Answers
Related