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.
The problem is how to structure the reading of the database.
- First a general read to check changes.
- If change: a Service object is created or deleted.
- 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