I was going through Builder pattern and had a couple of question that I thought needed clarification
- Is builder pattern implemented through Abstract class or through interfaces. There are few posts that uses interface https://sourcemaking.com/design_patterns/builder
https://refactoring.guru/design-patterns/builder
...can list more
and others uses abstract class https://www.dofactory.com/net/builder-design-pattern
Note: The way I think is that it should be implemented using Abstract class. This rationale is based on the assumption that this way I may/may not implement them in derived class (as there could be a possibility that a few concrete class does not implement them)...
This assumption could be entirely wrong though.
- If the above assumption is wrong then wont it violate LSP. Since one condition in LSP say that you cant have "not implemented methods" in your derived class.
Or I have misunderstood it completely...
Aucun commentaire:
Enregistrer un commentaire