I have a problem with design a few simple classes. I want a four classes: one recursively delete directory, another copy one dir to another same way. Another two does same as first two but they add observable behaviour: calculates few parameters like estimated time or percents of doing operation and fire up observers. What is the best way of design them?
but I have problems with violation of DRY principle in code that calculates percents and other values in observable class.
I may be move that code to abstract class but i need to extends that abstract class and appropriate Copy or Delete class, this is forbidden in java
I have decision to implement strategy pattern but this uml and my code still smell.
what is the best solution here, where are my mistakes?