Classification
• Association
• Inheritance
• Aggregation
• Using
• Instantiation
• Metaclass
These six
different kinds of class relationships, associations are the most general but
also the most semantically weak. Inheritance is perhaps the most semantically
interesting of these concrete relationships, and exists to express
generalization/specialization relationships. In our experience, however,
inheritance is an insufficient means of expressing all of the rich relationships
that may exist among the key abstractions in a given problem domain. We also
need aggregation relationships, which provide the whole/part relationships
manifested in the class's instances. Additionally, we need using relationships,
which establish the links among the class's instances
Association
We may
show a simple association between these two classes: the class Product denotes the products sold as
part of a sale, and the class Sale
denotes the transaction through which several products were last sold. By
implication, this association suggests bidirectional navigation: given an
instance of Product, we should be
able
to locate
the object denoting its sale, and given an instance of Sale, we should be able to locate all the products sold during the
transaction.
Semantic Dependencies
An
association only denotes a semantic dependency and does not state the direction
of this dependency (unless otherwise stated, an association implies
bidirectional navigation, as in our example), nor does it state the exact way
in which one class relates to another (we can only imply these semantics by
naming the role each class plays in relationship with the other). However,
these semantics are sufficient during the analysis of a problem, at which time
we need only to identily such dependencies. Through the creation of
associations, we come to capture the participants in a semantic relationship,
their roles, and, as we will discuss, their cardinality.
Cardinality Our example introduced a one-to-many
association, meaning that for each instance of the class Sale, there are
zero or more instances of the class Product,
and for each product, there is exactly one sale. This multiplicity denotes the
cardinality of the association.
In
practice, there are three common kinds of cardinality across an association:
·
One-to-one
·
One-to-many
·
Many-to-many
Inheritance
A
subclass may inherit the structure and behavior of its super class. Quality Classes and
Objects
"A
system should be built with a minimum set of unchangeable parts; those parts
should be as general as possible; and all parts of the system should be held in
a uniform framework"
We
suggest five meaningful metrics:
• Coupling
• Cohesion
• Sufficiency
• Completeness
Message
passing may thus take one of the following forms:
•
Synchronous An operation commences only when the sender has initiated the
action and the receiver is ready to accept the message; the sender and receiver
will wait indefinitely until both parties are ready to proceed.
• Balking
The same as synchronous, except that the sender will abandon the operation if
the receiver is not immediately ready.
• Timeout
The same as synchronous, except that the sender will only wait for a specified
amount of time for the receiver to be ready.
• Asynchronous A sender may initiate an action regardless of whether the receiver is expecting the message.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.