Say I used a library for forms that suggested:
class Shape class Circle extends Shape class Square extends Shape
but I want to introduce the concept of red shapes. I cannot change the library, but I can create:
class RedShape extends Shape
however, this cannot be easily extended to RedCircle , as it cannot distribute both RedShape and Circle .
I don't think the decorator pattern works here, but is there a way to achieve this?
Dryap source share