Suppose I haveam the designer of an interface IModel, which someone has to use (the one who implementswill be used by the implementer of a the controller (MVC)) and assume it. The interface contains funcA().
in the other side aAnother programmer needs to implement a specific class for the IModel.
I'm the one who designs the interface and I want to force the implementation of funcB.
My wish isI want to direct the programmer who implementsimplementation of funcA() by implementation ofto use another function, funcB(). Another case is forcing transparentThis forces some functionality of the specific "IModel"model class to be transparent.
For For example, the interface contains openFile(), but the specific class must contain the transparent functionality of encription (theencrypting the file).
What is better?
- Defining two interfaces: one I1 for those who use itthe controller side, and otheranother one, I2, for those who implement the specificmodel class.
when I1 <-- I2 mean, where I2 extends I1. - OwnMy own implementation of an abstract class like
AbsModelwhich implementsImodeland contains abstract functionfunctions.