Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM service impl class v/s Java Utility class or methods

Avatar

Level 8

Hello All,

 

Difference between the use cases of AEM service class (i mean service impl class), Java utility classes.

Even for the service impl class, we are passing the resource resolver object, other resources. Same case for Java utility methods. Then, in which scenario, we need to prefer AEM service impl classes over Java utility class (or methods). 

I know one point is: We can get Run mode specific config files details in service impl class. Where as these values to passed if you are calling java utility methods.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

AEM Prefers this hierarchy

 

Java™ API preference “rule of thumb”

The general rule is to prefer the APIs/abstractions the following order:

  1. AEM
  2. Sling
  3. JCR
  4. OSGi

Please go through these articles / documentation for more details:

https://www.linkedin.com/pulse/aem-apis-application-programming-interfaces-suresh-dhulipudi-za2if%3F...

 

https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/understand-j....

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

AEM Prefers this hierarchy

 

Java™ API preference “rule of thumb”

The general rule is to prefer the APIs/abstractions the following order:

  1. AEM
  2. Sling
  3. JCR
  4. OSGi

Please go through these articles / documentation for more details:

https://www.linkedin.com/pulse/aem-apis-application-programming-interfaces-suresh-dhulipudi-za2if%3F...

 

https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/understand-j....

Avatar

Administrator

@Mahesh_Gunaje Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni