Creating components under a package

When you create a IBM® Rational® Rhapsody® project, a component called DefaultComponent is created directly beneath the project level. You can also create additional components at this hierarchical level.

About this task

It is also possible to create a component as part of a package in the model. One of the advantages of this approach is that if you only want to generate code for a specific package, you only have to check out that package.

You can add a component to a package using any of the following methods:

When a component is created under a package, its default scope is the package to which it belongs.

Like other components, components that belong to packages can be assigned to be the active component for the project. When you create a component in a package, it automatically becomes the active component for the project.

Note: If you draw a component diagram under a package (rather than under the project), keep in mind that then it is not possible to draw a new folder on the diagram. The reason is because the folder element cannot be contained under a package.

Feedback