Adobe

AEM 6.3: Handling Feelings of Deprecation

Istock 593309604 Featured Image 1

Have you noticed new warnings showing up on your JSONObject? Have your Felix SCR Annotations not been looking quite right? If so, you may have a case of AEM 6.3.
 
Speak with your Doctor about AEM 6.3
 
AEM 6.3 is the latest version of Adobe Experience Manager. While this new version comes with some great new features such as Content as a Service and Core WCM Components, it also deprecates some common functionalities. Two of the most common functionalities deprecated in AEM 6.3 are Apache Sling Commons JSON and Apache Felix SCR Annotations.
 

Apache Sling Commons JSON

 
Apache Sling’s JSON library is used on many projects for simple JSON parsing and generation. Unfortunately, Apache’s legal team determined the basis for Apache Sling’s Commons JSON library, org.json has a unique license which is not compatible with the Apache 2.0 license used by Apache Sling. Thus, the library was deprecated and is now officially deprecated in AEM 6.3.
 
99% of lawyers give the rest a bad name
 
So what does this mean? Apache Sling Commons JSON is available in AEM 6.3 and will be available as a download from the Apache Sling website, but is no longer officially supported. If you are using the Apache Sling Commons JSON library in AEM 6.3 you should stop using it immediately and heavily consider removing any existing code to avoid future headaches.
So if Apache Sling Commons JSON is deprecated, what is the replacement? There are a few options:

  • Apache Johnzon – This library is used internally used for JSON parsing in Apache Sling and is available as a bundle download from Sling’s website.
  • org.json – Adobe’s Granite framework includes a bundled version of the org.json Java library
  • Gson – Google’s JSON library is available as a bundle and version 2.3.0 is available in AEM

The best option depends on your needs. Apache Johnzon is a good choice if you need a stable, open source library, but don’t need the full serialization options available in Gson. You will just need to install Apache Johnzon separately, but it’s simple to embed it into your code package.
org.json and Gson just work out of the box, however, they are tied to Adobe’s updates and thus may go away or not be updated to a more recent version.
 

Apache Felix SCR Annotations

The Digital Essentials, Part 3
The Digital Essentials, Part 3

Developing a robust digital strategy is both a challenge and an opportunity. Part 3 of the Digital Essentials series explores five of the essential technology-driven experiences customers expect, which you may be missing or not fully utilizing.

Get the Guide

 
Apache Felix’s SCR Annotations are used to easily define OSGi Services, Components and Properties. In OSGi R6, the OSGi consortium has released annotations for Declarative Services. These annotations duplicate the functionality of the Apache Felix SCR Annotations and thus the Apache Felix SCR annotations were deprecated.
 
The Department of Redundant Bureaus
 
Here are some good blog posts about this change including:

The advantages to the new OSGi DS annotations are:

  • They’re supported! The Apache Felix SCR Annotations are no longer supported and though Open Source are not guaranteed to work in the future.
  • More concise, for example:
    • Apache Felix SCR Annotations:
      @Component(immediate=true)
      @Service(MyService.class)
    • OSGI DS Annotations:
      @Service(service={MyService.class},immediate=true)
  • Better property support – the OSGi DS Annotations support settings static properties inline and moving configurable properties to a separate class which makes it easier to write clean code by not mixing property retrieval with service code.

 

Other Symptoms of AEM 6.3

 
If you have other symptoms of AEM 6.3, talk to one of Perficient’s Adobe Certified Architects about upgrading your codebase to AEM 6.3.

Point of Clarification from Cedric Huesler

A common misconception.. at the point when we deprecate features within AEM we don’t stop supporting them (in you can call support / file DayCare ticket and get help). The ‘deprecation’ is a communication that we are no longer planning to extend the feature in the future release – and in most cases – there is a replacement feature that shall be used instead. We are at the earliest removing the feature in the next release – but mostly we allow our partner/customers multiple years time to refactor their code until we remove it.
We are stop “supporting” features when the EOL of the release they are in has reached.

 
 

About the Author

Dan is a certified Adobe Digital Marketing Technologist, Architect, and Advisor, having led multiple successful digital marketing programs on the Adobe Experience Cloud. He's passionate about solving complex problems and building innovative digital marketing solutions. Dan is a PMC Member of the Apache Sling project, frequent Adobe Beta participant and committer to ACS AEM Commons, allowing a unique insight into the cutting edge of the Adobe Experience Cloud platform.

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up