Template Pattern
What's Template Pattern
In this pattern, we will use an enum that will be responsible for providing a stylization for your controls, thus making your code less coupled and more practical to be developed
For example, in your application has a color pattern, font size and a particular font, you can create an enum that will represent this stylization for you and in case you need to change something in those controls you just need to change that enum.
How to apply this method
For example if in your application you have a need to create custom labels with a specific font and with different font sizes
Create a enum
You can create the enum in the root of the controller package
To use the template
In your controls now you can use your previously created template to maintain a standard styling.
The enum template created above is just an example of how to use this pattern, you can customize it according to the needs of your application.
Last updated