mardi 6 août 2019

Is there a common structure for reading database and create new objects based on its configuration?

Writing a C++ application that logs data from N computers.

A Service object logs data from one computer.

The application reads database for configuration changes. And instantiates or deletes a Service object based on the configuration.

application

The problem is how to structure the reading of the database.

  1. First a general read to check changes.
  2. If change: a Service object is created or deleted.
  3. Then in Service::Service a new read from database to get all configuration data.

What's a good way to structure it? Create a class Database that pulls data and creates/deletes Service objects (Builder pattern)? Or a while loop that pulls and creates/deletes Service objects? Looking for an intuitive idea.

Aucun commentaire:

Enregistrer un commentaire