![]() |
![]() |
![]() |
![]() |
Class Specification--Nested Tab Class Specification--Nested Tab
A nested class is a class that is enclosed within another class. Classes may contain instances of, inherit from, or use a nested class. Enclosing classes are referred to as parent classes, and a class that lies underneath the parent class is called a nested class.
Figure 24 Class Specification--Nested Tab
Refer to the descriptions earlier in this chapter and in the Introduction to Specifications chapter for information on the specification elements not covered in the following section.
A nested class is typically used to implement functionality for the parent class. In many designs, a nested class is closely coupled to the parent class and is often not visible outside of the parent class. For example, think of your computer as a parent class and its power supply as a nested class. While the power supply is not visible outside the computer, the task it completes is crucial to the overall functionality of the computer.
Note: Nested classes can be cut and pasted.
To add a nested class to a class specification:
- 1 Create and name a class.
- 2 Display the Class Specification.
- 3 Click the Nested tab.
- 4 Right-click to display the shortcut menu, and then click Insert.
- 1 Click Query > Add Classes.
- 2 Select the nested class and place it in the Selected Classes list box.
To delete a nested class from a class specification:
- 1 Select the nested class from the Nested tab in the Class Specification.
- 2 Right-click the class to display a shortcut menu.
- 3 From the shortcut menu, click Delete.
- 1 Select the name of the nested class from the Nested Classes list box in the Class Specification.
- 2 Press the DELETE key.
If you delete a nested class that is also a parent to other nested classes, all the nested classes will be deleted.
Note: When you attempt to delete a nested class from a Class Specification, a warning message will appear to verify the deletion.
To relocate nested classes from the browser to a specification:
Classes and nested classes can be moved from the browser to the Class Specification Nested tab. If you move a class (NewClassA) from the browser and place it directly on top of a class (NewClassB) on the Nested tab, NewClassA becomes nested underneath NewClassB. However, only one level of class nesting appears on the Nested tab. You can view all levels of nesting in the browser.
For additional information on the browser, refer to The Browser chapter.
To move nested classes between class specifications:
Nested classes can be dragged and dropped between Class Specification Nested tabs.
Rational Software Corporation
http://www.rational.com support@rational.com docs@us.ibm.com Copyright © 1993-2000, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |