I have a design question. When writing an application where there are several components that share some attributes, and differ in others both in terms of GUI (windows forms) and back end, how would one theoretically approach this?
For example, I have an application where I have 4 different types of a product. The forms for entering product details all share 3 different fields. So far, easy - have a base class, then derive the 4 forms out of this base class. However, say, 2 products share a certain behaviour which is THE SAME for both of them. Of course, I could have an interface which defines methods, then have these 2 product entry forms implement this interface, but since interface provides no default implementation, wouldn't it be a waste to do that? Since I would have to provide an implementation in each class and if it is exactly the same, it would be code repetition.
I could of course put this method in the base class and have 2 forms derived from it. If my forms share more than one common element and not share other elements, what would be the sanest, most logical way to represent this without having to rip my hair out?