Skip to Content
avatar image
Former Member

Difference between aggregation and association in ui5?

Hello experts,

Can anyone of folks tell the difference between aggregation and association in ui5 with details ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 26, 2014 at 12:21 PM

    Hi,

    as per UI5 documentation,

    An aggregation is a special relation between two UI element types. It is used to define the parent/child relationship within the above mentioned tree structure. The parent end of the aggregation has cardinality 0..1, while the child end may have 0..1 or 0..*. The element's API - as generated by UI5 tools - offers convenient and consistent methods to deal with aggregations (e.g. to get, set, or remove target elements). Examples are table rows and cells, or the content of a table cell.

    An association is another type of relation between two UI element types which is independent of the parent/child relationship within the above mentioned tree structure. Directed outgoing associations to a target of cardinality 0..1 are supported. They represent a loose coupling only and are thus implemented by storing the target element instance's ID. The most prominent example is the association between a label and its field.

    tables rows and cells is the example of aggregation whereas label associated with input field is the example of association.

    Hope this helps.

    Regards,

    Chandra

    Add comment
    10|10000 characters needed characters exceeded