Interview Deck Flashcards
Explain the AEM stack (architecture).
Java Platform– AEM is a Java web application. It requires server-side Java Runtime Environment.
Granite Platform– Adobe’s open web stack. It forms the technical foundation on which AEM is built.
OSGi Framework– OSGi is dynamic software component system for Java. In this system, an application is composed of an assemblage of bundles that can be dynamically installed, started, stopped, and uninstalled without shutting down the application.
CQSE Servlet Engine– AEM includes the built-in CQSE servlet engine which runs as a bundle within the OSGi framework.
JCR Content Repository– CRX content repository is an implementation of Java Content Repository
Specification (JCR). All data within AEM is stored here.
Sling Content Delivery– AEM is built using Sling, a Web application framework based on REST principles that provides easy development of content-oriented applications. Sling uses CRX Content Repository as its data store.
AEM Modules– WCM, DAM, Workflow, etc.
Customer Applications– Websites that run on AEM.
What are the major tech stack upgrades in AEM since CQ?
Jackrabbit Oak – offers improved performance and scalability compared to JCR
Sightly – new templating language that enforces separation of markup from logic and offers XSS protection
Touch UI – built using Coral UI framework, it supports touch enabled devices
Search– default search engine has been upgrade to Apache Solr
What is headless AEM?
It allows content stored in the JCR to be retrieved and used without rendering the content within an AEM content page.
What are the layers in OSGi?
Bundles– jar components with extra manifest headers
Services– holds the service-side of the framework;
keeps the service registry and manages it
Life-Cycle– manages and keeps track of the frameworks and bundles lifecycle state; used to install/uninstall framework objects and start/stop them
Modules– the bundle space; holds the bundles that are installed on the framework
Security– optional layer; when active, validates the bundle signatures and controls component access rights; extends the Java 2 security architecture
Execution Environment– bottom layer on which bundles live; selected to fit the underlying hardware or operating system
What are the benefits of OSGi?
Reduced complexity - bundles hide internals, expose via services
Reuse - Modular code
Dynamic Updates - Easy deployment, keep the system running
What are the differences between JAR and bundle?
Both have pom files Jar: Packaging tag of "jar" in pom.xml Consume by calling methods Bundle: Used in OSGI runtime Packaging tag of "bundle" in pom.xml Consume by calling services Bundle is a jar with extra manifest headers.
What are the differences between package and bundle?
Both have pom files
Package:
Contains content, files, or even other bundles
Deployed into the Package Manager
Packaging tag of “content-package” in pom.xml
Bundles:
Jar with extra manifest headers
Install via Felix Console
Packaging tag of “bundle” in pom.xml
How do you install an OSGi bundle using the CRX repository?
Copy the bundle into the /apps/install folder.***
Create the project directory, then install the bundle from the package manager
What is REST principle?
Uniform Interface– individual resources are identified using URLs but are different from the representation sent to the client
Stateless Interactions– none of the clients context is to be stored on server side between request; all necessary information to service the request is contained in URL, query parameters, body, or headers
Cacheable– clients can cache the responses, but only on those defined as cacheable to prevent client from sending inappropriate data
Client-Server– clients and server are separated from each other and neither side is concerned with the other.
Layered System– client cannot tell if it’s connect to the end server or intermediate; intermediate layer helps enforce security policies and enable load-balancing
Code on Demand– optional constraint where server temporarily extends functionality of a client by the transfer of executable code
Differences between REST and SOAP.
REST:
Representational State Transfer
Uses URI for business logic
Is architectural style
Inherits security measures
SOAP:
Simple Object Access Protocol
Uses service inference for business logic
Uses own security
Only XML data
Describe the Apache Sling script resolution process.
HTTP Request Content resolution Get resource type Locate script Match script Include options. Execute script.
What is a sling model?
Sling models are annotation driven POJOs (Plain ol’ Java Object) which are mapped automatically from Sling objects like resources, request objects and OSGI services. The use of annotations helps reduce complexity/lines of code.
Declared with @Model(adaptables = Resource.class)
Explain how sling is content-centric.
Each HTTP request is mapped onto content in the form of a resource node, instead of static file path resolution.
What are the commonly used Sling APIs?
ValueMap – easy way to access a resource’s properties
ResourceResolver– defines service API which may be used to resolve Resource objects
ResourceResolverFactory - used to access ResourceResolver instances
ResourceProvider– API for providers of resources
Resource– pieces of content on which Sling acts; an Adaptable to get adapters to other types
ResourceWrapper– wrapper for any Resource delegating all method calls to the wrapped resource by default
ResourceUtil– provides helper methods for dealing with resources
Do you use JCR or Sling Resource API to update individual resources, and why?
JCR is lower level and slightly faster, but Sling is higher level which makes it more abstract and easier to code.
Best practice is to use higher level apis when possible.
After updating the resource using Sling Resource API, what must you do to finish?
Commit the changes and close the resource resolver.
Which provider service scans CRX repository for artifacts and provides them to the OSGi installer?
Sling JCR Installer
What is the JCR?
Java Content Repository - Content repository that combines features of the traditional relational database with those of a conventional file system:
Hierarchy– content can be addressed by path
Semi-structured content– can store structured documents, like XML, (which can have variable fields)
Access Control and Locking– can restrict access to different parts of the content hierarchy based on policies or ACLs; also supports locking of content to prevent conflicts
What kind of indexing does AEM now use?
Oak indexing which is not enabled by default. AEM also supports: Solr Apache Lucene Property Index Traversal Index
You want to install bundles through CRX only in the author instance. Which folder name can you use for that purpose?
install.author
You want to request a JSON representation of the content. What do you have to do with the request?
Change the extension to .json
Why we need TAR Compaction?
If we are using Tar files as the storage, it tends to grow in size and starts claiming disk space every time when data is created or updated as data in tar files are never overwritten rather it keeps adding new versions. To mitigate the same, AEM has garbage collection mechanism which is known as ‘Tar Compaction’ to remove the unused data and reclaim the disk space.
Explain David’s content model.
David Model:
Data First, Structure Later. Maybe.
Drive the content hierarchy, don’t let it happen.
Workspaces are good for versioned JCR projects.
Beware of Same Name Siblings.
References considered harmful.
Files are Files.
IDs are evil.
What’s the difference between Event Handler and Event Listener?
EventHandler:
Used at the Sling level
Watches for Sling properties?
EventListener:
Used at the JCR level
Watches for node changes