DataType | Class |
---|---|
Primitives | Objects |
Methods are familiar | Methods are not familiar |
Operators do not change | Operators can change |
New developers know precisely what you mean | New developers have only a vague idea |
Tend to be scalar (single value) | Tend to be complex types |
Equivalent values ⇨ same identity | Two distinct objects can have the same value |
Probably not a base for generalization (inheritance) | Maybe a base for generalization (inheritance) |
Relationship | Description |
---|---|
Dependency | uses a |
Association | has a |
Aggregation (Association) | has a |
Composition (Association) | has a |
Generalization | is a |
Strength | UML Relationship |
---|---|
Strongest | Generalization (Inheritance) |
Stronger | Composition |
Strong | Aggregation |
Strong | Association |
Weak | Dependency |
Weakest | Realization (Implementation) |
Subtype Requirement: Let ϕ(x) be a property provable about objects x of type T. Then, ϕ(y) should be true for objects y of type S where S is a subtype of T.
The purpose of generalization is to solve design problems. If you don't have a design problem, don't use generalization.