【问题标题】:what's the difference between Config.getString() and configurationService.getConfiguration().getString()Config.getString() 和 configurationService.getConfiguration().getString() 有什么区别
【发布时间】:2021-06-20 13:52:55
【问题描述】:

无论哪种方式,我们都可以从.property 文件中获取我们想要的字符串属性。那么在hybris平台中Config.getString()configurationService.getConfiguration().getString()有什么区别呢?

作为另一个问题;

如果我们getString() 一个属性同时存在于project.propertieslocal.properies 并且具有不同的值,我们会得到哪一个?

【问题讨论】:

    标签: java hybris


    【解决方案1】:

    我没有比较两者之间的区别,但作为最佳实践,ConfigurationService 是首选。

    来自Example of a Code Review Checklist

    Configuration - Use the ConfigurationService interface rather than the de.hybris.platform.util.Config object.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-27
      • 1970-01-01
      • 1970-01-01
      • 2010-10-02
      • 2011-12-12
      • 2010-09-16
      • 2012-03-14
      • 2012-02-06
      相关资源
      最近更新 更多