Internal Class Structure


The behavior of a class can be partly or fully described by a set of objects that the class references and/or owns. Each of these objects is called a property of the class.

Figure 1-17 shows that the GeneralLedger class has three properties: Posting is owned by composition, while PostingRule is "owned" by aggregation. (See the section "Aggregation" in Chapter 2 for definitions of these terms.)


Figure 1-17: Properties

A GLAccount instance owns the Postings made to it, which is why that relationship is a composition. A PostingRule, on the other hand, exists independent of any particular GLAccount instance, which is why that relationship is an aggregation.

An object that is contained by composition is also referred to as a part. Figure 1-18 shows the GeneralLedger class as having two parts .


Figure 1-18: Parts

Note that the notation for a part can also contain a multiplicity value (see the section "More About Attributes," earlier in this chapter). This value can appear in the upper-right corner of the object box or in square brackets next to the object name .

Ports can be connected to parts within classes, as shown in Figure 1-19 (see the section "Interfaces, Ports, and Connectors," earlier in this chapter). Each part provides the functionality that external entities request via the associated port.


Figure 1-19: Ports and parts

Anyone in the Accounting department who needs the current balance of a given GLAccount accesses that instance via the Retrieve Balance interface. The software that handles the posting of journal entries goes through the Post Journal Entry interface in order to create an instance of the Posting class, which posts to a particular GLAccount.

Figure 1-19 is an example of a composite structure diagram. This type of diagram shows the internal structure of a class or a collaboration (see the next section, "Collaborations").

A special kind of port, called a behavior port, passes requests for specific behavior to the instance of the given class itself, rather than to any instances that the class may contain. Figure 1-20 shows the symbol for a behavior port.


Figure 1-20: Behavior port



Fast Track Uml 2.0
Fast Track UML 2.0
ISBN: 1590593200
EAN: 2147483647
Year: 2004
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net