I have a class named MANAGER
public abstract class MANAGER
{
}
Nothing complex 🙂
This class have multiple subclasses
example AD_MANAGER
public class AD_MANAGER : MANAGER
{
#region MEMBRES
private AD_PROVIDER ad_provider;
#endregion
//================================================================================
#region ACCESSEURS
public AD_PROVIDER Ad_provider
{
get { return ad_provider; }
set { ad_provider = value; }
}
#endregion
//================================================================================
#region CONSTRUCTORS
public AD_MANAGER()
{
this.ad_provider = new AD_PROVIDER();
}
#endregion
//================================================================================
#region Public methods
#region Get
Stuff Here ..
#endregion
#endregion
}
And other ones.. Each Manager “manage” a specific class, named ENTITE. So for AD_MANAGER is used to manage a AD_ENTITE the ENTITE class contains only fields no methods..
So here’s my question:
How can I specify that every MANAGER class have to implement a method for example isNull() but with parameters of type _ENTITE class related..
So AD_MANAGER Have to implement a bool isnull(AD_ENTITE aENTITE) method, and PERS_MANAGER Have to implement bool isnull(PERS_ENTITE aPERS) method.
With interface you can’t declare bool isnull(anytype); So how can I do this such thing?
Thank you for trying to help me!
Create an interface:
Then your client classes need to implement
IAdManagerlike: