Sling Settings deprecated - Alternative approach and best practices | Community
Skip to main content
Level 9
November 18, 2022
Solved

Sling Settings deprecated - Alternative approach and best practices

  • November 18, 2022
  • 1 reply
  • 881 views

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-slingsettingsservice/td-p/412597

 

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,

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mani_kumar_

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

1 reply

Mani_kumar_
Community Advisor
Mani_kumar_Community AdvisorAccepted solution
Community Advisor
November 19, 2022

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

Level 9
December 1, 2022

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