I’m creating a small project which will manipulate some internal components of the project(big one).
Now every components does something in its own way but its basically a same thing. For ex:
Each component can delete temp files stored inside it. But each temp files are of a different type, like in component 1, temp files are type Object1 and in another component Objectx etc.
So I though of creating a class called Manager, which will contain methods like delete inside, and there will be componentManager extending the Manager class and providing the implementation for methods inside.
Should I make Manager abstract?Small problem, lets say Manager has these two methods.
public void delete(Object1 obj){
}
public void delete(Objectx obj){
}
Component1 will use first delete and some other component will use other delete.
Or should I implement them seperately all together without having to extend the same class?
What would be nice way to implement this? thank you
I think you should create an Interface Deleteable with the method
and your objects Object1, …, Objectx should implement it. Your Manager could have the method: