博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Association, Composition and Aggregation in UI5, CRM, S/4HANA and C4C
阅读量:2438 次
发布时间:2019-05-10

本文共 1797 字,大约阅读时间需要 5 分钟。

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当然也没有继续存在的意义了,需要跟着被析构。

700

而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:技术上来说,可以彼此分开独立存在。

700

CRM

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

386
578

区别:

  • 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一致。

700

C4C

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

Association的语法如下图:

700

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

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

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

700

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

321
531

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24475491/viewspace-2152635/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24475491/viewspace-2152635/

你可能感兴趣的文章
Fedora Core 4 基础教程 (上传完毕)(转)
查看>>
删除MSSQL危险存储过程的代码(转)
查看>>
Mysql多台数据库同步问题(转)
查看>>
红旗软件:树立国际的Linux品牌(转)
查看>>
引导系统-MBR(转)
查看>>
Linux 文件系统-ext3 文件系统介绍(转)
查看>>
Linux中NFS介绍(转)
查看>>
Linux中安全性概述(转)
查看>>
两台SQL Server数据同步解决方案(转)
查看>>
Mssql高级注入笔记(转)
查看>>
Novell红帽争设新分支 市场陷入圈地战(转)
查看>>
数据库分离后不能附加了(转)
查看>>
一些Linux桌面欣赏(转)
查看>>
MySQL转移到PostgreSQL的痛苦经历(转)
查看>>
关系数据库SQL语言详解(转)
查看>>
简单构划Linux集群(转)
查看>>
freebsd安装与配置(转)
查看>>
Debian DUNC之争(转)
查看>>
Linux2.4.18核心移植到s3c2410全过程(转)
查看>>
Linux常见命令:进程查看(转)
查看>>