You tear off an attribute to gain access to the encapsulated
features of a part. This can be necessary when an attribute is in
itself a part and you want to connect to one of its features. The
torn-off attribute is not actually a separate part but a variable
that represents the attribute itself or points to it.
For example, in an address book application you might tear off
attributes as follows:
- You might have a Person part that contains both homeAddress
and workAddress attributes, both of which, in
turn, could contain street, city, and state
attributes.
- By tearing off either the homeAddress or workAddress
attribute, you can create a new part that contains street,
city, and state attributes.
- Tearing off a homeAddress or workAddress
attribute makes the nested street, city,
and state attributes directly accessible. Now that
the nested attributes are directly accessible, you can
make connections to and from them, as well as to their
associated events and actions.
Tearing Off Attributes