How Sling Model Resolution works? | Community
Skip to main content
Level 4
February 20, 2023
Solved

How Sling Model Resolution works?

  • February 20, 2023
  • 2 replies
  • 1288 views

I was asked in an interview to explain step by step how sling model resolution works. I tried my best but as per the interviewer it wasn't enough. Can anyone please let me know stepwise how the sling model resolution occurs (interview-level). Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Shiv_Prakash_Patel

Hi @arindam6600 , Sling model resolution is a sub-part of sling resolution. In the component .html file we have used the sling models. The sling model gets invoked when resolution occurs.

In simple terms, sling models are simple POJO classes that are mapped automatically with Sling Objects (resource, request objects) and allow us to access jcr node property values directly into java classes.

Please refer to the below article for more details:-

Hope this could help you !!

Regards

Shiv

 

 

 

2 replies

Peter_Puzanovs
Community Advisor
Community Advisor
February 20, 2023

Hi Arin,

 

Justin the original creator of Sling Model Framework does in depth explanation of how Sling Model Resolution works in his slides[1]

 

Sling models by Justin Edelson (slideshare.net)

 

Regards,

Peter

Shiv_Prakash_Patel
Community Advisor
Shiv_Prakash_PatelCommunity AdvisorAccepted solution
Community Advisor
February 20, 2023

Hi @arindam6600 , Sling model resolution is a sub-part of sling resolution. In the component .html file we have used the sling models. The sling model gets invoked when resolution occurs.

In simple terms, sling models are simple POJO classes that are mapped automatically with Sling Objects (resource, request objects) and allow us to access jcr node property values directly into java classes.

Please refer to the below article for more details:-

Hope this could help you !!

Regards

Shiv

 

 

 

Shiv Prakash