Which design pattern to use - Java? -


i have 3 classes, a, b , c extend d. there methods common class a, b , c have put in d there methods common a , b, b , c , c , a. can add in layer of inheritance i.e create class e (put common methods a , b), d (put common methods b , c) , f (put common methods c , a) there design pattern relating this?

you try use composition instead of inheritance. create other classes , let a/b/c have references objects of these other classes. way more flexible anyway.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

android - MPAndroidChart - How to add Annotations or images to the chart -