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
BedrockMission!

Learn More

View all

Sign in to view all badges

Deep diving into Sling models PT2 | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,128 likes

Total Posts

6,131 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,128 likes

Total Posts

6,131 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

21-06-2020

BlogImage.jpg

Deep diving into Sling models PT2 by Digitalum

Abstract

Part 2: How to properly annotate your Sling models
There are two types of developers in this world: those who care about clean code and those who don’t. I like to believe that I’m part of that first group.

Throughout the projects that I’ve worked on, I’ve often seen some mad things in source code that I believe is the result of developers being either extremely lazy or not knowing any better due to a lack of knowledge/training. Here is a list of things I believe to be wrong when you create Sling models:
1. Set the defaultInjectionStrategy to optional
2. Use both SlingHttpServletRequest and Resource as adaptables
3. Use @Inject everywhere
4. No name added to the property using @Named

Read Full Blog

Deep diving into Sling models PT2

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager