I would like to achieve the polymorphic behavior through composition , instead of multilevel inheritance.in below example code bluerectangle is derived from rectangle and bluecircle is derived from circle. so the problem is I might have same depth in inheritance hierarchy so the job is to reduce the hierarchy level using composition instead of multilevel inheritance .can we achieve the polymorphic behavior here with composition, if yes then what design needs to be followed here. currently I just started reading design pattern so it seems to be similar to bridge pattern , but not able to proceed further without having proper pointers. I would like to achieve the polymorphic behavio