samedi 18 juin 2022

How to use decorator pattern while using builder pattern? [closed]

I'm trying to do class library for client.I'm writing classes that do a logging. And these logs have more than one feature. For example, printing in HTML or XML format, adjusting the font size and color, the name of the logging person, logging level, logging to Oracle or mssql database, etc. I made this work using the builder pattern. However, when using the client, I want it to be able to change these names or add new features. I thought the most suitable design pattern for this was the decorator, but I don't know how to use it with the builder pattern. Do you have any code example for this Or does anyone have a better suggestion? How can I handle this problem ?

Aucun commentaire:

Enregistrer un commentaire