Spice up your Sling Models With Lombok
The Digital Foundation Blueprint provided by Adobe greatly streamlines AEM implementation methodology. WCM Core Components, an integral part of this blueprint provide key building blocks components for some of the most common use cases. To extend these core components, one of the recommended implementation pattern is the Sling Model Delegation Pattern.
In our experience, using this delegation pattern requires writing a lot of boiler plate code for e.g:
- We have to implement every method defined by the interface and delegate it.
- If new methods are introduced (for e.g when we upgrade to newer version of WCM Core Components), we need to implement those methods and delegate those also else, we may run into runtime or compile errors in some cases.
Lombok to the rescue!
Author: Varshish Bhanushali
AEM News Newsletter
Join the newsletter to receive the latest updates in your inbox.
Sign in or become a AEM News member to join the conversation.
Just enter your email below to get a log in link.