Author Topic: Why insert classes below components?  (Read 314 times)

mse

  • EA User
  • **
  • Posts: 97
  • Karma: +1/-0
    • View Profile
Why insert classes below components?
« on: March 06, 2019, 07:51:36 pm »
I got this issue with a user where he prefers to insert classes under the component whereas I think the class should be under the package. My reasoning is the following: a package is a design-time organizational concept and classes should be under packages. Packages also get translated into namespaces in our C++ code. I can also select the package and generate code. I cannot select the component and generate code. Why are classes allowed to be under components? What use-case would justify dragging and dropping a class into a component?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9378
  • Karma: +258/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Why insert classes below components?
« Reply #1 on: March 06, 2019, 08:07:17 pm »
UML (and EA even more) allows you to do almost anything.

Many things don't even make sense (Classes under an Activity, or a Use Case)
Just stick to what you know works for you.

If Classes in Packages work for you then that is the guideline

Geert

PS. There are pragmatical reasons to avoid nested elements as well such as locking, version control, document generation

steen.jensen

  • EA User
  • **
  • Posts: 88
  • Karma: +1/-1
    • View Profile
Re: Why insert classes below components?
« Reply #2 on: March 07, 2019, 08:54:29 am »
Hi Gert
Can you elaborate wy nested element is not good?
Quote
PS. There are pragmatical reasons to avoid nested elements as well such as locking, version control, document generation
We are using it today for ouer requirement catalouge,
And for ouer Application catalouge

The EAscript "Element count recursiv" does not count nested child elements without modification :)



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9378
  • Karma: +258/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Why insert classes below components?
« Reply #3 on: March 07, 2019, 03:46:54 pm »
I'm not saying it's not good, but it's not practical for a couple of reasons

- Apply user lock on package locks owned elements, but the same doesn't happen when locking an element that owns other elements
- Version control works on package level, not element level
- Owned elements don't have a less visible relation to their owner. e.g. Insert related elements won't show owned elements or owner
- Moving owned elements from one owner to another is too easily done by accident and often goes by unnoticed until later
- Document generation with virtual documents is easier with packages (drag package onto model document)

Geert

Richard Freggi

  • EA User
  • **
  • Posts: 162
  • Karma: +7/-4
    • View Profile
Re: Why insert classes below components?
« Reply #4 on: March 08, 2019, 02:17:16 am »
I'm pretty sure that in UML 2.5 a component is just a class.  But I'm too lazy to actually look it up.

qwerty

  • EA Guru
  • *****
  • Posts: 10497
  • Karma: +231/-190
  • I'm no guru at all
    • View Profile
Re: Why insert classes below components?
« Reply #5 on: March 08, 2019, 02:38:02 am »
Quote
11.8.6 Component [Class]

11.8.6.1 Description

A Component represents a modular part of a system that encapsulates its contents and whose manifestation is replaceable within its environment

....

11.8.6.3 Generalizations

Class

q.