Using an interface to ensure every class has the same property
I have a property on a page that gets a query-string value, I need this to
be on all related pages. The pages already inherit a base class, and I
don't want the property here as not everything that inherits this base
class needs this particular property.
My idea was to create an interface with this property and have every page
that needs the property implement this interface.
Is this good practice, or should I inherit the base class into another
class with just this property and then have all pages inherit this instead
of the base?
Thanks
No comments:
Post a Comment