vendredi 9 décembre 2016

Design pattern for 2 varities of the same feature

All,

I am developing a feature that will on execution of an operation write the logs to a file server using ftp. Note that the write to file server will happen only if a file server is configured. If no server is configured the operation will exit and return the status. The flow is something like this:

1. Execute operation 2. If file server connected (check in DB and ping), write logs 3. return

Now I would like to know if there are design patterns for this, same feature, however the scope of the feature will vary depending on whether or not some configuration is done. I would much appreciate help on this for 2 scenarios:

  1. Static - If the DB config is one time during boot up - as in post bootup the system can "assume" that the file server is there or not based on the read from DB

  2. Dynamic- When the system is up and running, I might bring up a file server and configure DB. Ideally for this scenario the system should detect the file server and start writing logs to it, rather than being forced to reboot the system.

Requesting help in this regard.

Thanks

Aucun commentaire:

Enregistrer un commentaire