1
votes

From a documentation of AEM following is said:

AEM is built using Apache Sling, a web application framework based on REST principles 
that  provides  easy  development  of  content-oriented  applications.

Why was AEM created with Apache Sling (which uses HTTP) and not with Jackrabbit or CRX (without HTTP)?

I can understand its use if the content repository is on another machine, as in the case where you use the Run Mode author and the resources are on another machine, but I do not understand why it is used for the realization of AEM.

1

1 Answers

2
votes

Because of the following reasons and more:

  • it abstracts away the JCR API, which is quite cumbersome
  • an JCR implementation is basically just an OSGI component running in Felix (probably also other OSGI runtime) and Sling just grabs the data from it. JackRabbit itself, or OAK, could both be replaced by different persistence layers. Sling provides APIs to access other data stores as well using its own APIs.
  • Sling lets you abstract away the representation of content from its internal structure very easily.
  • it provides a consistent component api, which can be used to implement real applications on top of JCR while being more productive. It basically follows from #2
  • HTTP (as used used by Sling) is an interface providing various ways to deliver content and is easier to embed in a complex network infrastructure, as the web runs on it.

You don't need Sling but it clearly makes you more productive, when you are building web applications as it is a flexible representation layer on top.