dimanche 19 novembre 2023

Is this UML diagram violating the Interface Segregation Principle?

I have created this UML diagram which applies the Template method design pattern: UML diagram

Both concrete classes share a lot of the logic whithin the template methods createTask and completeTask, with small variations for each concrete implementation, so I went for the Template method design pattern. However, one of the concrete classes does not need validation, so it implements the abstract method performValidations as an empty void method.

Is this violating the Interface Segregation Principle? Or would it be OK in this situation to leave the implementation of this abstract method in the concrete class empty?

Aucun commentaire:

Enregistrer un commentaire