.NET and Java J2ee design pattern interview question :-What is the difference between Object and class adapters?

 Posted by articlesmaint on 3/23/2011 | Category: .NET Framework Interview questions | Views: 1755

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


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response