RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
UI5使用Association和Aggregation方法是什么

这篇文章主要介绍“UI5使用Association和Aggregation方法是什么”,在日常操作中,相信很多人在UI5使用Association和Aggregation方法是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”UI5使用Association和Aggregation方法是什么”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

成都创新互联公司2013年至今,先为花都等服务建站,花都等地企业,进行企业商务咨询服务。为花都企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

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

UI5使用Association和Aggregation方法是什么

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

UI5使用Association和Aggregation方法是什么

CRM

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

UI5使用Association和Aggregation方法是什么

UI5使用Association和Aggregation方法是什么

区别:

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

UI5使用Association和Aggregation方法是什么

C4C

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

Association的语法如下图:

UI5使用Association和Aggregation方法是什么

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

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

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

UI5使用Association和Aggregation方法是什么

到此,关于“UI5使用Association和Aggregation方法是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


当前标题:UI5使用Association和Aggregation方法是什么
本文链接:http://scyingshan.cn/article/psiccp.html