▲ | nunobrito 8 hours ago | |
Thanks for the explanation, very detailed. > How do you avoid factories? Doesn't you code end up littered with worse code? Easier for me to use "public abstract class" and then leave open methods inside like "protected abstract doAction();" that are forcefully implemented on each variation of that class. There is still just one base implementation, I guess the main difference is using strong typed classes that keep the specific code inside specific classes. With factories one tends to end up with a very large source code file that details with too many specific different topics, was making maintenance and testing harder afterwards. Or maybe I just never really understood properly the value of factories. |