Sling Models & OSGi
The backbone of robust AEM component and service development
Sling Models and OSGi services are the core of AEM's server-side development model. They power every component, every service, and every integration point in an AEM application. Understanding how to design clean, testable Sling Models and maintainable OSGi service layers is the difference between an AEM codebase that a team can confidently evolve and one that accumulates debt with every sprint.
Coverage
What this covers
Sling Model Design Patterns
Adaptable interfaces, injection strategies (@ValueMapValue, @ChildResource, @OSGiService), delegation chains, and the Exporter framework for JSON serialisation.
OSGi Service Architecture
Service registration and reference patterns, ConfigurationAdmin, factory configurations, service ranking, and declarative services (DS) annotations.
HTL (Sightly) Best Practices
Writing maintainable HTML Template Language templates that correctly separate presentation from business logic — and use data-sly-use correctly.
AEM Core Components Extension
Extending WCM Core Components using the Delegation Pattern and Sling Model delegation — avoiding the maintenance burden of full custom rewrites.
Unit Testing with AemContext
Writing effective unit tests for Sling Models and OSGi services using the AEM Mocks library (io.wcm.testing.aem-mock) and JUnit 5.
Bundle & Dependency Management
Managing OSGi bundle dependencies, avoiding circular references, and designing bundles with clean boundaries that support independent deployment.
Differentiators
Why work with me
Teaching through doing
I have trained AEM developers on Sling and OSGi patterns — which means I can explain the mental models behind the code, not just the syntax.
Cloud-compatible patterns
Some Sling and OSGi patterns that work fine on AEM 6.5 break or behave differently on AEMaaCS. I help teams write code that is cloud-compatible from the start.
Review and refactor experience
I have reviewed and refactored legacy AEM codebases. I know what common anti-patterns look like and how to resolve them systematically.
Ready to discuss your Sling Models & OSGi project?
Consulting, training, or advisory — reach out to find the right fit.
Read my articles on Sling Models & OSGi on the blog.
Browse articles