More on Sling Models


TransmorgifierApache Sling Models work with the Sling Adapter API. The Adapter API, the Sling Java-based transmogrifier, transforms one type of Java object into another. Models enable you to create value objects that will be automatically rendered from existing data. One common use is in Sightly support classes. A resource can be converted to a value object that is easy to use in Sightly. Models are defined with a set of annotations and can be used with any object that works are an “adaptable” in the Adapter API. Being part of Apache Sling, they can be used with Adobe Experience Manager.

Dan Klco of 6D Labs has created a blog post, Sling Models for Fun and Profit, that briefly documents this feature.

Other sources of information about Apache Sling Models can be found in the Apache Sling documentation and a slide deck from Justin Edelson (with examples).  See my description of the Adapter API, as well.

Most importantly, extend Apache Sling Models for AEM by using AEM Objects Sling Models of the ACS Tools Commons.

About The Author

Deke departed Southern Alabama as a young man, leaving the humidity and fire ants behind. The fire ants are catching up with him. He works for Adobe. Despite that, his opinions expressed on this site are his own and should never, ever, be attributed or blamed on Adobe. Ask him what he thinks of chiggars sometime. Home Page | GitHub | Adobe Blog | Twitter | LinkedIn