AEM Sling Model Constructor Injection | AEM Community Blog Seeding

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

959

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

959

Correct Answer

1.1K
kautuk_sahni
Community Manager

27-05-2020

BlogImage.jpg

AEM Sling Model Constructor Injection by Sourcedcode Blog

Abstract

Sling Models field injection, @inject, are used to support injection of AEM Library-specific context objects. However, there is an alternative way to inject AEM objects into Sling Models, and its called Constructor Injection.

The benefits of Sling Model Constructor Injection:
1. Does not store the injection references to the adaptable.
2. Since it does not store injection references to the adapted object, the result of the adapted object has a smaller memory byte size.
3. Reducing AEM application consumption

Read Full Blog

AEM Sling Model Constructor Injection

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager