what is difference between adaptables and adapters in aem
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Adapters define the behavior and structure that Adaptables are converted to.
An Adaptable is an object that can be "adapted" into another type.
Purpose: It provides a flexible way to convert an object of one type into another type that may be required in a particular context.
Example:
SlingHttpServletRequest
Resource
Page
An Adapter is the target type that an Adaptable can be converted into.
Purpose: Adapters are the interfaces or classes into which an Adaptable can be transformed.
Example:
ValueMap
ResourceResolver
Adaptable is source objects that can be adapted, for example Resource.
Adapter is the Target object produced after adaptation, for example, Page.
Call .adaptTo(Class) on an Adaptable, where the result of that method is Adapter.
Views
Replies
Total Likes
Adapters define the behavior and structure that Adaptables are converted to.
An Adaptable is an object that can be "adapted" into another type.
Purpose: It provides a flexible way to convert an object of one type into another type that may be required in a particular context.
Example:
SlingHttpServletRequest
Resource
Page
An Adapter is the target type that an Adaptable can be converted into.
Purpose: Adapters are the interfaces or classes into which an Adaptable can be transformed.
Example:
ValueMap
ResourceResolver
In AEM:
In short: Adaptables are objects that can be adapted; adapters are the logic that performs the adaptation.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies