UML Baiscs Flashcards
(59 cards)
What is the basic premise of the UML
A software system can be modeled as a collection of collaborating objects
Why do we build models
Models succinctly describe reality, show essencial details and filter out non-essential details
This allows us to focus in the big picture
Such focus allows us to deal with the complexity of software development
The result is a better understanding of the requirements, cleaner designs, and more maintainable systems
What are class attributes?
An attribute describes the data values held by objects in a class
What are the properties that can and have to be specified when creating classes attributes
Name of the attribute, its type and its visibility are required. We can than define its initial value, multiplicity and its changeability
How can we define the visibility of a class attribute?
Public (+)
Private (-)
Protected (#)
Package (~)
What are class operations
They describes a function or transformation that may be applied to or by objects in a class
How do we specify operations in a class?
Name, parameters, the result type and its visibility
How do we call an operation instance? What about when an operation have several methods that implement it?
The implementation of an operation is called a method
And when there are more than one method the implements an operation we call it polimorphic operation
What are links and associations and how do they relate to each other?
Links are relationships between objects
Associations are a description of the links between objects
What are the possible interpretations of associations?
Conceptually, associations are bi-directional
You can show navegability of associations with an arrowhead (implies that’s the source object has a reference to the target object)
What are the multiplicities in associations?
They specify a restriction on the number of objects in a class that may be related to an object in other class
Why is the obvious way for storing data in a UML class diagram?
The obvious option in to store as an attribute under the classes
What is the second option for storing data in a UML class diagram?
The second option is to use a multi-valued attribute for the data, where we have an array of grades under the student.
What is the limitation of using a multi-valued attribute for the data?
We might have a problem of data correspondence
What is the third option for storing data in a UML class diagram?
The third option is to use an association class to model the properties of the association between the two associated classes.
How does the association class help in storing grades?
The association class allows us to store the data under the association between the classes
What is the limitation of using an association class for storing data?
The limitation is that if there are more than one link between the objects, we can only keep track of the most recent one, losing the historical information.
What is generalization in software engineering
Is a relationship between classes of the same kind, where a class can be specialized into different subclasses
How can generalization be represented in a class diagram
Using a triangle symbol
What are the two approaches to performing generalization?
The two approaches are top-down and bottom-up. In top-down, we start with a general class and specialize it into specific subclasses. In bottom-up, we identify similar classes and generalize them into a more general class.
What is the benefit of using inheritance in generalization?
Inheritance allows us to extract common attributes, relationships, and operations and put them in a superclass. This promotes reusability and simplifies modification of descriptions.
What is overriding in inheritance?
Overriding is when a subclass defines its own version of an operation that is already defined in the superclass. The subclass’s version of the operation will be used instead of the superclass’s version when applicable.
What are overlapping and disjoint coverage in generalization?
Overlapping coverage means that some instances can belong to multiple subclasses. Disjoint coverage means that instances can only belong to one subclass and not to multiple subclasses.
What is completeness coverage in generalization?
Completeness coverage refers to whether all possible instances are covered by the subclasses. It can be either complete, meaning all instances are covered, or incomplete, meaning there may be instances not covered by the subclasses.