Book a Demo

Author Topic: Proper way to model packages, components, namespac  (Read 5155 times)

Christoph W

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Proper way to model packages, components, namespac
« on: August 26, 2009, 07:44:30 am »
Hello all,

This is more of an academic question. I'm trying to figure out how to properly model packages, components, and namespaces. In my case I'm modeling .Net assemblies. When I import a .Net assembly, all the classes are organized in packages, but there are no components representing those DLLs.

When I manually add components, I can move classes into those components. However, since packages are not allowed in components, I'm losing the hierarchical namespace structure, since every class in a component/assembly could have its own namespace.

Of course that cannot be the point. So my question is, what is the proper way to add component information to a package and class hierarchy so that components own their classes and I still have a namespace hierarchy? Or am I not supposed to move classes into components at all?

Some academic or practical advice would be greatly appreciated.

Thanks, Christoph

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Proper way to model packages, components, name
« Reply #1 on: August 26, 2009, 04:21:11 pm »
I think that is exactly the reason Sparx came up with the "Packaging Component" recently.
Unfortunately this new element is still a work in progress an not yet fully usable.
In your case I would not move the classes into the components since you cannot add packages in a component (that is something that is only allowed on those packaging components) and you would loose the whole structure of your namespaces.
I don't really use component and deployment diagrams a lot, but I think you should be looking at the components "realizing classifiers" to create the link between the component and the classes, and create an artifact that represents the dll (or whatever binary you create).
Then I think there is a "manifest" relation between the component and the binary.
The Artifact can then be used on deployement diagram to show on which node (actual machine) you will be deploying the binaries.

I think... :-/

Geert

Christoph W

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Proper way to model packages, components, name
« Reply #2 on: August 26, 2009, 04:29:49 pm »
Hello Geert,

thanks for the elaborate answer. I'll see what I can find out about those packaging components. Otherwise I guess I'll have to stick with your alternate proposed solution.

I'll try to remember to post here which solution I ended up with.

Greetings, Christoph

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Proper way to model packages, components, name
« Reply #3 on: August 27, 2009, 09:45:16 pm »
Hi Christoph,

Geert describes on facet of the areas you mention. Package components are a very new addition to the EA feature set, and the logic is still being worked through.

There are other EA features that might move you forward, as a complement or an alternative to package components. In the EA help index, look up Namespace | Root to get started. This part of the EA paradigm involves a (small) amount of learning and experimentation, but often produces workable results with little overhead.

HTH, David

PS: Don't discard the package component idea though. Anything beyond a very simple namespace hierarchy is a candidate for that approach.
No, you can't have it!

Christoph W

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Proper way to model packages, components, name
« Reply #4 on: August 27, 2009, 11:18:11 pm »
Hello all,

thanks for all your helpful comments. In the meantime I downloaded the latest EA version (7.5), which already includes the packaging components. They indeed work just the way I would expect, even though I agree, it is still work in progress (e.g. they are missing from the 'add new element' dialog).

I'll also take a look at root and namespaces topic as this is something I have never bothered to fully understand ;-)

Thanks a lot, Christoph

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Proper way to model packages, components, name
« Reply #5 on: August 28, 2009, 09:33:45 pm »
Good stuff Christoph,

I suppose we should have mentioned that the new features required EA 7.5...

There are a few threads in the forum, started since EA 7.5 was released, that will give you some insight into package components. There is discussion of how these might best work and be used from theoretical points of view. There is also some information on how the EA implementation fits (or not) the concept. [Note: I am not a contributor to the themes of these discussions. Geert et al are have provided sage advice in this area; I defer to their wisdom.]

Please post back to tell us how this comes out.

David
No, you can't have it!

Christoph W

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Proper way to model packages, components, name
« Reply #6 on: August 30, 2009, 11:24:21 pm »
So I started using packaging components to properly organize my class hierarchy into the physical assemblies. Unfortunately, only later I found out that as of now packaging compononts are truly lacking some functionality. For example, I cannot use the 'Expose Interface' feature from the toolbox on packaging components. So I guess for now I'll have to live w/o component diagrams and just use class diagrams.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Proper way to model packages, components, name
« Reply #7 on: August 31, 2009, 04:12:46 pm »
Yep, exposing interfaces would be one of those lacking features for Packaging Components.

Geert