I have a superclass with two subclasses. The two subclasses both have a method with checks whether a chapter has content. For subclass 1 this method is HasContent(int chapterID) and for subclass 2 this is HasContent(int chapterID, int institution). As you can see subclass 2 has an extra parameter. The purpose of both methods is the same.
I was thinking to put the method HasContent in the superclass. Do you think i need to do this? If so, how should i implement this? Or is it more wisely to put both methods in their own subclass?
EDIT:
The body of HasDocuments looks like this: Subclass1:
Database DB = new Database(); int res = DB.ExecuteSpRetVal(chapterID, mInstitutionID); if (res > 0) return true; else return false;
Subclass2:
Database DB = new Database(); int res = DB.ExecuteSpRetVal(chapterID); if (res > 0) return true; else return false;
Edit: Updated according to the question update.
Since you are clearly having almost the same logic in both methods, I’d refactor it like this: