Shivprasad Koirala
.NET and Java J2ee design pattern interview question :-What is the difference between Object and class adapters?
By Shivprasad Koirala in ASP.NET on Mar 23 2011
  • Shivprasad Koirala
    Mar, 2011 23

    Answer:

    Below are the main difference between these 2 patterns.

    Object adapter
     
    Can adapt classes as well as sub classes since uses composition
    More flexible since dynamic polymorphism can be used with composition

    Class adapter

    Can adapt classes or sub classes not both. As a result no need to re implement the entire adaptee
    More efficient since class adapter acts as adapter and adaptee

    regards,
    Please do visit my .NET Design patterns and Java J2EE design pattern interview questions

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS