I'm working on a project where there is a set of objects that the program builds them using configuration files that describe each object's attributes.
Here's some description about these objects' classes :
- Each class belongs to only one of three categories A, B, C.
- Each class in any category differs in its attributes from the classes in the same category. So I can't write a generic class to build instances from classes in a certain class category.
- Building an instance from any class in any category is NOT a complicated process.
Now the question is : If I want to implement - or say adapt - SOLID principles, clean code, and some design patterns in the project to make the code maintainable, flexible, reusable, extensible and readable, should I :
-
Write a builder class for each category, that each class in this category has a method to build an instance of it from within its category builder class (e.g builder class for category A and a builder method for every class in this category),
-
or should I write a builder class for each class regardless of to any category that class belongs ? (e.g class 1 that belongs to category A has its builder class, and class 2 that belongs to category C has its builder class and so on) .
Please don't mix what I'm trying to do with the regular serialization, here the configuration files are written by the user
Aucun commentaire:
Enregistrer un commentaire