Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Common Myths Around Sling Model

Avatar

Community Advisor
  1. Sling model is only back-end business logic provider to AEM components.
  2. Adaptable are just a way to get respective sling object reference. For example if you need slingRequest object in sling model then make your sling model adaptable to HttpSlingServletRequest.
  3. You can not get a value from sling model in a servlet or in any other class.
  4. When you need a reference of an OSGI service, you have only one way, that is @ OSGiService annotation.
  5. You can export only JSON data thru sling model exporter.
  6. You can not extend one sling model into another sling model.
  7. Sling model can to be created outside of the designated package in AEM.
  8. One Interface can not be a Sling Model, whenever you need to create a Sling Model you will have to write a pure POJO concrete implemented java class.
  9. You can only read properties of a node thru sling model, you can not change a node property thru sling model.
  10. Constructor injection..! Nothing like that in sling model.

More details can be found on below URL

https://aemhelper.blogspot.com/2021/08/common-myths-around-sling-model.html

 

I found it very informative and useful.

Thanks

Umesh Thakur

3 Replies