Working with a Namespace or a Package
Go Up to Modeling Procedures
Contents
We use the term namespace in implementation projects and the term package in design projects.
Packages (namespaces) provide a mechanism for organizing modeling elements into groups. A package can contain a set of modeling elements that can be identified by their names. The most common use of packages is to group classes. Contents of a package can be displayed in a special type of class diagrams -- Package diagrams (or Namespace diagrams).
To open a namespace
- In the Model View, double-click the namespace (or a package) element. The diagram of this element opens in the Diagram View.
- You can also right-click a namespace and choose the Open Diagram command on the context menu.
To view a namespace
- After you open the diagram of a namespace (or a package) in the Diagram View, you can view its content. The diagram displays modeling elements contained in this namespace.
- You can use the Add commands on the context menu of a class or interface in a namespace diagram to add fields and methods directly in the Diagram View.
To delete a namespace
- In the Diagram View or the Model View, right-click a namespace (or a package).
- Choose Delete on the appeared context menu.
- Deleting a namespace also deletes all its content.
To rename a namespace
- In the Diagram View or in the Model View, right-click a namespace (or a package) and choose Rename on the appeared context menu. This invokes the in-place editor for the title of the namespace (or package) element.
- Otherwise, you can edit the (Name) property of the selected namespace in the Object Inspector.
- Renaming a namespace (or a package) accordingly changes this name in all source files.