Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Sling Settings deprecated - Alternative approach and best practices

Avatar

Level 10

Hi

To get rid of the usage of slingsettings to determine run mode, author or publish , what is the approach adobe might have finalized by now. I read posts and arguments with counter arguments on it's usage but do we have a permanent backfill for the api by adobe?

 

if not, is the suggested approach to use a component with config that returns author or publisher and have it in specific config.environment.author (setting the properties within the config as author and environment(stage/prod/dev)) and config.environment.pub (setting the properties within the config as pub and environment(stage/prod/dev)).This config then be used within models and servlets?

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/alternative-of-deprecated-...

 

Want to hear opinions thoughts and best practices around it. Do not want to create something that will not be reusable in the future.

 

thanks,

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can have OSGi configuration and create a utility method which determines the run mode from the configuration

This would be an ideal approach and easy to refactoring in future if something comes up by Adobe

 

 

Hope this is helpful

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

You can have OSGi configuration and create a utility method which determines the run mode from the configuration

This would be an ideal approach and easy to refactoring in future if something comes up by Adobe

 

 

Hope this is helpful

Avatar

Level 10

@Mani_kumar_ Thanks.. just sent a private chat to align since i feel we are ultimately thinking the same?