UI5

UI5使用Association和Aggregation描述控件之间的关系。

Aggregation:parent和子控件在lifecycle上存在依赖关系:

When a ManagedObject is destroyed, all aggregated objects are destroyed as well and the object itself is removed from its parent. That is, aggregations won't contain destroyed objects or null/undefined.

比如UI5的转盘控件Carousel: 一旦转盘被析构,里面显示的page当然也没有继续存在的意义了,需要跟着被析构。

而Association描述了在lifecycle层面的一种soft dependency关系:

Managed associations also form a relationship between objects, but they don't define a lifecycle for the associated objects. They even can 'break' in the sense that an associated object might have been destroyed already although it is still referenced in an association. 

最明显的例子就是控件和其label的关系,比如button和label:技术上来说,可以彼此分开独立存在。

CRM

CRM的Genil model存在三种类型的relation,可以在doman CRM_RELATION_KIND里查看:

区别:

  • Association: Link between any kind of objects. Can also be defined across components with root or access object as target. 依赖关系最为loose的一种relation,可以用来连接跨model之间的节点。

  • Aggregation: Binds child objects to a root object. Only access and dependent objects can be aggregated. 只适用于同一模型的节点之间的关联。

  • Composition: Like an aggregation, but composed child objects always exist. 特殊类型的Aggregation。目标节点的Cardinality为1或者1..n

S/4HANA

只有两种:association或者composition。Composition的含义同CRM里的aggregation,而association的含义同UI5和CRM中的association一致。

C4C

只有两种: association或者composition。C4C的这两种relation多了一个限制:relation的目标BO必须和源BO在同一个部署单元Deployment Unit,或者目标BO位于Foundation部署单元内。

Association的语法如下图:

association的multiplicity只支持[0,1]或者[1,1], 如果不显式指定,默认为[1,1].

C4C relation的一个特色是,一旦申明了一个子节点之后,系统会默认生成一个对应的composition。

下图第4行代码会自动生成一个[0,n]的从root节点到Item节点的composition。


要获取更多Jerry的原创技术文章,请关注公众号"汪子熙"或者扫描下面二维码:

Association, Composition and Aggregation in UI5, CRM, S/4HANA and C4C的更多相关文章

  1. JAVA类与类之间的全部关系简述+代码详解

    本文转自: https://blog.csdn.net/wq6ylg08/article/details/81092056类和类之间关系包括了 is a,has a, use a三种关系(1)is a ...

  2. 关联,聚合和组合(复合)--Association, Aggregation and Composition

    概要 Association, Aggregation and Composition are terms that represent relationships among objects. Th ...

  3. powerdsigner Association Multiplicity

    这一篇來告诉一个不容易分辨的关系图式:Association(结合)的各种類型,除了了解它的涵义 外,也让各位可以看图說故事,知道它背后所要表达的意义. Association结合 Associati ...

  4. 如何将Twitter的内容导入到SAP CRM和C4C

    Twitter的内容导入SAP CRM Interaction Center呼叫中心 具体步骤查看我的博客Twitter(also Facebook) is official integrated i ...

  5. [emacs] Drawing uml under emacs org-mode using plantUML - 类图

    [emacs] Drawing uml under emacs org-mode using plantUML - 类图 // */ // ]]>   [emacs] Drawing uml u ...

  6. 1 UML基础

    学习设计模式的过程中,发现相关的作者们都会用UML类图来表示一个模式的整体脉络,这种方式确实直观明了,既能体现宏观思路.又能兼顾实现细节.真的是很妙的工具.在开始正式学习设计模式之前,有必要对UML有 ...

  7. UML类图关系总结

    在UML类图中,常见的有以下几种关系: 泛化(Generalization) 实现(Realization) 关联(Association) 聚合(Aggregation) 组合(Compositio ...

  8. UML常用图的几种关系的总结

    在UML的 类图中,常见的有以下几种关系: 泛化(Generalization),  实现(Realization), 关联(Association), 聚合(Aggregation), 组合(Com ...

  9. Understanding the RelationshipType Enumeration [AX 2012]

    Understanding the RelationshipType Enumeration [AX 2012] 3 out of 3 rated this helpful - Rate this t ...

随机推荐

  1. Codeforces Round #529 (Div. 3) C. Powers Of Two

    http://codeforces.com/contest/1095/problem/C 题意:给n找出k个2的幂,加起来正好等于n.例如 9,4:9 = 1 + 2 + 2 + 4 思路:首先任何数 ...

  2. 三个键print scroll、pause

    上班族或是办公室白领每天都几乎跟键盘打交道, 那么键盘上的PrtSc SysRq(print screen).Scroll Lock.se Break(pause break).numlock等有何作 ...

  3. 批处理中setlocal enabledelayedexpansion的含义

    setlocal enabledelayedexpansion       延迟变量全称"延迟环境变量扩展",要理解这个东西,我们还得先理解一下什么叫扩展!       CMD在解 ...

  4. MATLAB教程

    基本操作:https://www.w3cschool.cn/matlab/ MATLAB2018a下载安装教程http://www.zhanshaoyi.com/6938.html

  5. 设定计划的SMART原则

    SMART: Specific,Measurable, Attainable,Result-based, Time-based 设定计划,如果不去执行,设定目标,而不去实现,那也算是背叛自己的诺言,终 ...

  6. my.资料_副本_破六欲

    http://www.nok2.com/fxjy/816.html 梦幻之家礼包网讲解梦幻2破除心魔 来源:www.nok2.com作者:礼包达人时间:2016-04-01 22:11 最近听到不少小 ...

  7. getResourceAsStream小结

    前提:我用的是gradle工程,文件放在resource下,resource对应的就是类路径,文件的路径和代码的路径保持一致,如Client的包名和peizhi.properties一致,例如Clie ...

  8. 彻底理解和解决移动WEB开发中CLICK点透问题

    在移动WEB开发中,有时候可能会出现点透问题,本文将围绕这个TAP点透问题,详细的讲述到底什么是点透,为什么会出现点透,如何避免出现点透,如果不可避免的出现了,如何解决解决移动WEB开发中CLICK点 ...

  9. 为什么CPU缓存会分为一级缓存L1、L2、L3?有什么意义?

    https://baijiahao.baidu.com/s?id=1598811284058671259&wfr=spider&for=pc 简介:CPU缓存是CPU一个重要的组成部分 ...

  10. git使用笔记-提高篇

    一.分支.合并 1.合并一个特定提交 a specific commit git cherry-pick commit-id 把commit-id代表的本次提交合并到当前分支,如果有冲突需要解决后,提 ...