From: David Vallner Date: 2006-02-17T08:12:27+09:00 Subject: Re: extend quesion Dňa Štvrtok 16 Február 2006 20:23 Phil Tomson napísal: > Conditional inheritance considered weird? > > At one point or another much of what we now consider common practice was > thought to be weird. ;-) > By all means, play around with uncommon concepts. Except I'm more likely to use established patterns that do the same. Matter of taste? Certainly. Up to the point where one way doesn't work and the other does - at the end of the day, it's usefulness that matters. In the specific case of doing so only once, conditional inheritance does roughly what delegating to a strategy would. But in the first posted example, the latter approach gives you a few more points of flexibility that were needed to achieve the expected behaviour. Maybe there is a problem that is indeed most elegantly solved by runtime conditional inheritance. Considering that delegation can technically replace inheritance, as seen in prototype-based OO programming languages, I personally doubt it. But this wasn't such a problem. David Vallner