How to decide when to use object adapter and when to use class adapter?
Problem statement: To create social networking web site and provide import functionality from
https://www.journaldev.com/1487/adapter-design-pattern-java Adapter design pattern is one of the structural design pattern and its used so that two unrelated interfaces can work together. The object that joins these unrelated interface is called an Adapter. - Two Way Adapter Pattern While implementing Adapter pattern, there are two approaches – class adapter and object adapter – however both these approaches produce same result.
Class Adapter – This form uses java inheritance and extends the source interface, in our case Socket class. Object Adapter – This form uses Java Composition and adapter contains the source object.