I'm not quite sure how to explain this (that's why the title is kinda weird) but I'll have a go. Basically I'm doing some Oject-Oriented Design and I want to represent various different types of object, each of which can have various actions which it can perform. An example might help: things such as a File which can have delete, rename and open actions and an Application which can have run, close, uninstall and move to other monitor actions.
My first thought was to use an interface (IAction) and have all my classes for the different types of objects implement that interface, but that won't work as each object will have different methods which the inteface won't know about this.
The question then arises of how, if they all have different methods, the methods will actually get called - because at runtime it will be impossible to know which objects have which methods. That's another problem - I'd like each object to be able to produce a list of the methods it has, and then let me call any of them.
Does this need to be done with reflection? I'm pretty sure it can't be done with standard interfaces - but I'm a bit new to all this OOP design so I'm not entirely sure.