0

I am trying to understand the difference between these two concepts:

For subSystem, I have found a website: https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-component-diagram/

enter image description here

For the additive composition, on this website: https://cpentalk.com/618/illustrate-composition-hierarchical-composition-composition

people said

"Additive composition: we put (add) two or more components together to create a new component which combines their functionality. If A and B are two components, then the new component is a combination of the corresponding interfaces of A and B. A and B are not dependent and do not call each other, only the functionality is combined to create a new component."

In the OnlineStore subsystem example, because OrderSystem component is calling the Catalogue component. For it to be an additive composition, should all the component inside be independent?

enter image description here

Can I say my example above is the additive composition because profile and bank_account are independent? I basically use some glueCode to combine their interface together so there is no component are dependent. Do you think it is a good example of the additive composition?

randomguy
  • 79
  • 5
  • _People said_ is what the cross is about. There is no term _additive composition_ in UML. So _people_ defined it and it may mean what it will. – qwerty_so Dec 16 '21 at 10:41

1 Answers1

0

Subsystems and components

The UML defines the subsystem as a subpart of the system:

A unit of hierarchical decomposition for large systems. A subsystem is commonly instantiated indirectly. Definitions of subsystems vary widely among domains and methods, and it is expected that domain and method profiles will specialize this construct.

The UML defines a component as an autonomous subpart of the system/subsystem:

Component can always be considered an autonomous unit within a system or subsystem. (...)
A Component is a self-contained unit (...)
A Component is a substituable unit that can be replaced at design time or run-time by a Component that offers equivalent functionality based on compatibility of its Interfaces.

The subsystem is itself a component. So subsystem and component represent the same kind of reality. It's just subtle differences in the wording: subsystem is mainly used for decomposing larger systems in smaller parts, whereas component is often used for assembling smaller pieces in more complex parts. SO the different terms just suggest different levels of decomposition/scale in larger systems.

Component composition in UML

There are multiple ways of composing components to assemble more complex ones. UML does not define anything in this area. Your definition for additive composition seems to correspond to a juxtaposition: the two components are kept unrelated and offer their services to the outside world, as if they were separate components.

Unfortunately, your diagram is ambiguous in that regard: We don’t know for sure if the glue just forwards the behavior or if it transforms or combines it. We don’t even know if it’s the same interface, since the interface has a different name (the methods having the same name can be pure coincidence).

Accordingly, you should better provide the original interfaces to the outside world via a port and delegation connectors (example here):

![enter image description here

Christophe
  • 68,716
  • 7
  • 72
  • 138
  • I agree with most of the answer. However, there is a problem in the diagram. The UML 2.5.1 says: _"[...] simple Ports (Ports with a single required or provided Interface)[...]. When connecting simple Ports, normal Connector notation for assembly or delegation may be shown connected to the ball or socket symbol rather than to the Port symbol itself."_ Since you have a complex port and the sub components don't have ports, you must connect directly to the sub components. Also the sub components must be parts, in which case there would be a colon in front of their names. – Axel Scheithauer Dec 17 '21 at 11:17
  • @AxelScheithauer Thanks foor this review. Better like this ? – Christophe Dec 17 '21 at 17:52
  • Yes, this is better. Except for the port on the upper border. It is not simple, so it should not have connectors graphically connected to the lolli. However, I think in this case, there is no ambiguity, since these are delegation connectors and the opposite ports are simple. Still, according to the rules, it is not formally correct. – Axel Scheithauer Dec 21 '21 at 09:39