I have a web application (in ASP.NET MVC) with a quote controller. This controller can handle several types of quotes, MotorQuotation, PropertyQuotation, etc.
Currently, it uses inheritance, that is, a quote model, and its children to model the domain. Different classes of children have differences in the data they store, and not on their behavior. The difference in behavior will be related to their validation methods, since validations may differ depending on which unique fields the child classes can store.
The question is, how does someone model quote objects using composition instead of inheritance?
source
share