Search code examples
namespacescomponentsumlmodelingenterprise-architect

Nesting packages and classes inside components in Sparx Enterprise Architect (EA)


In the software model I created using EA 13, my top-level nodes contain packages. Each package contains components, which can also contain sub-components. There are several levels of sub-sub-components. Finally, the detailed design of each component is represented by class diagrams under each sub-sub-sub[...]-component. My classes are contained in the software component they describe.

I would like to be able to separate my classes into several packages, mimicking the Java package structure of the corresponding implementation. My problem is that it is not possible for a EA component to contain a package. If I create a package in the class diagram, then it will appear at the same level as the highest-level component in the Project Browser.

My expectation: Root Node / Package / Component / Sub-component / Java package / Class

What I obtain: Root Node / Package / Java package / Component / Sub-component / Class

The only workaround I have found is to create a component to emulate the Java package, but I feel like I am twisting EA.

Is there a way to achieve this? Or am I completely missing something?

Thank you.


Solution

  • You aren't missing anything. Only packages can contain packages. I haven't checked the UML specs since I'm used to that since ages. The only way to mimick a package structure is to create stereotyped classes (using your own profile). EA offers a PackagingComponent, but that's a stereotyped package and can not be placed inside of elements either.

    You could send a feature request. But it's probably more effective to do something you really like.