Author Topic: components and artifacts  (Read 484 times)

ngong

  • EA User
  • **
  • Posts: 186
  • Karma: +0/-2
    • View Profile
components and artifacts
« on: August 23, 2020, 12:25:54 am »
For a component, what is the best way to enter and show an artifact (by which the component is deployed in a node) like in Figure 11.42 Optional "white-box" representation of a Component in Unified Modeling Language 2.5.1?

I can enter a filename in Files but I was not able to make it visible on the component diagram.
Rolf

Richard Freggi

  • EA User
  • **
  • Posts: 306
  • Karma: +11/-5
    • View Profile
Re: components and artifacts
« Reply #1 on: August 23, 2020, 12:20:08 pm »
My understanding is that artifacts should be displayed in Nodes (deployment diagram), not in Components.

ngong

  • EA User
  • **
  • Posts: 186
  • Karma: +0/-2
    • View Profile
Re: components and artifacts
« Reply #2 on: August 23, 2020, 02:25:51 pm »
That is my understanding too, Richard, if by in you mean owns. A component does not own an artifact. An artifact still exists even if a related component may not, any longer.

However, a component may be related to an artifact, e.g. a Sort component, coded as a singleton class Sort.java,  could be hosted as a service in binary in a file-artifact named UtilityServices.jar. UtilityServices.jar is created to get loaded (deployed) on a Server node.  We may state after loading, the Server owns that artifact. Our UML standard recommends to capture that relationship as one value - the filename - in an artifacts compartment of the component UtilityServices.jar.

Please have a look at the link  Figure 11.42 Optional "white-box" representation of a Component from UML 2.5.1 standard.

My problem with EA 15.1 is: How to get an artifacts compartment for a component? Is the artifacts compartment simply missing? As a work-around one could introduce a stereotype defining a certain tag. Or:  Would it be possible to add a custom compartment to an element of type Component? How?
Any idea?
Rolf

Richard Freggi

  • EA User
  • **
  • Posts: 306
  • Karma: +11/-5
    • View Profile
Re: components and artifacts
« Reply #3 on: August 24, 2020, 01:44:44 am »
Hi Ngong, by "displayed in" I mean "displayed in".

qwerty

  • EA Guru
  • *****
  • Posts: 11402
  • Karma: +295/-263
  • I'm no guru at all
    • View Profile
Re: components and artifacts
« Reply #4 on: August 24, 2020, 04:36:34 am »
Tautology?

q.

Modesto Vega

  • EA User
  • **
  • Posts: 527
  • Karma: +14/-7
    • View Profile
Re: components and artifacts
« Reply #5 on: August 24, 2020, 06:13:01 pm »
Section 11.6.4 Notation of the UML 2.5.1 specification - please see https://www.omg.org/spec/UML/2.5.1/PDF, clearly states that this should be possible.
#
Quote
"Additional optional compartments “realizations” and “artifacts” may be used to list the realizing Classifiers (Classifiers reached by following the realization property) and manifesting Artifacts (Artifacts that manifest this component – see 19.3)."

The figure ngong quoted, Figure 11.42, shows an example of how to do this.

I cannot find a way to get Sparx to show any of the "whitebox" optional compartments, but perhaps I don't know how.

ngong

  • EA User
  • **
  • Posts: 186
  • Karma: +0/-2
    • View Profile
Re: components and artifacts
« Reply #6 on: August 25, 2020, 02:43:45 am »
Thank you for commenting Modesto and Richard.

@Richard: Sure, I know what "displayed in" means, Richard. My problem was to map your wording about the relation between a node and an artifact to something I can find in UML standard. "Displayed in" is not listed as a known. relation. Even, I am not sure if "owns" is something defined there. What I mean is, that in EA the project browser shows a node and if you open the tree, it shows the artifact. I think, "owns" is the right wording about it. A diagram is just a window into the model. The model is listed in the project browser.

@Modesto: thank you, your comment encourages me to find a workaround in my current project.

Rolf
Rolf

qwerty

  • EA Guru
  • *****
  • Posts: 11402
  • Karma: +295/-263
  • I'm no guru at all
    • View Profile
Re: components and artifacts
« Reply #7 on: August 25, 2020, 03:46:13 am »
You can write a shape script using 
Code: [Select]
shape ChildElement. Of course you need to stereotype your component.

q.