【问题标题】:what is the difference(benifits) between using sling model and Model creating using WCMUSE?使用吊索模型和使用 WCMUSE 创建模型有什么区别(优点)?
【发布时间】:2016-10-13 13:19:58
【问题描述】:

和创造有什么区别

@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class MyModel {  }

和

public class MyModel extends WCMUsePojo { }

【问题讨论】:

    标签: aem sightly sling-models htl


    【解决方案1】:

    Sling documentation 很好地涵盖了这一点,主要优点是:

    • 便于数据检索的注入注释
    • 易于从其他 Sling 模型扩展
    • 单元测试的简单设置

    文档中强调的缺点(在组件覆盖方面缺乏灵活性,依赖于 service.ranking 配置)正在由 SLING-5992 解决,它允许将特定模型实现映射到资源类型.

    【讨论】:

      猜你喜欢
      • 2019-02-08
      • 2012-09-15
      • 1970-01-01
      • 1970-01-01
      • 2019-01-29
      • 2011-02-24
      • 1970-01-01
      • 1970-01-01
      • 2020-01-24
      相关资源
      最近更新 更多