For example: we have a few classes representing geometric objects (rectangle, ellipse, and triangle).
An interface is defined to ensure that serviced classes have methods that servant needs to provide desired behavior.
Thus the “moving” code appears in only one class which respects the “Separation of Concerns” rule.
There are two ways to implement this design pattern: This simple Java example shows the situation described above.
Eleventh Annual Conference on Innovation and Technology in Computer Science Education, University of Bologna.