DEV Community

Discussion on: Final classes in Java

Collapse
 
firuzzz profile image
Jose Luis Romero

If the class is final, there's a reason for, composition pattern is not a workaround to weaken/break classes design.

Collapse
 
evanoman profile image
Evan Oman

With composition you are using the object exactly as intended, not sure how it could weaken or break the class design.

Collapse
 
firuzzz profile image
Jose Luis Romero

He stated "..is extend the class by using composition"
That's not extending anything.
The reason of this post is so basic (shouldn't even exist), to include a misconception like that

Thread Thread
 
rhymes profile image
rhymes

I think what he means is that you can extend its functionality by composition.

I don't think the post shouldn't exist, at least one person appreciated it...

In general basic content is useful for beginners, we're not all at the same stage in our careers or paths.