Unit 2- Introduction to Object-oriented modeling Flashcards
Goals: – how the concepts object and class fit together. – how classes are identified. – how attributes of classes are described. – how methods of classes are described. – how associations between classes are described. – what the Unified Modeling Language (UML) is.
What is a class?
It is a structure that is used to create digital objects which are central elements in the object-oriented software development process.
What is the difference between a class and an object?
Multiple objects can be created from one class. The class serves as a template to define which elements (attributes & methods) make up the object.
What is an analysis model?
It is the result of the object-oriented analysis, which is used for communication between developers and the client and/or the user of the system.
What is the procedure to identify classes, necessary for the software system?
- Mark all nouns in a problem statement as candidates for classes.
- Check whether the nouns that have been identified can be described using other
nouns or if they have associations or dependencies with other nouns. If one of the two
statements is true, the noun is modeled as a class. - If the noun is used to add details to another noun, it is modeled as an attribute of a
class. - Check all remaining words that are neither a class nor an attribute for relevance and,
if necessary, remove them from the list of candidates for classes.
What is an attribute as a property of a class?
Attributes (property of classes) are static elements of classes. Concrete values of the object can be saved in an attribute. They are used exclusively for saving values and can be understood as free memory inside of an object.
What are methods as functions of classes?
Methods (functions, operations) are dynamic elements of classes. The result of methods can be saved in attributes of the class or in newly created objects. They are used to describe the behavior of objects.
What do you define when modeling methods?
- the name of the method
- the parameters (required objects & values that are needed for processing the method)
- the return value (defines the data type of the object in which the result of the method is stored)
What do you define when modeling attributes?
- the name of the attribute
- the data type (defines how the value of the attribute will look like)
- the constant (specifies whether the value of the attribute can change or not)
- the default value (specifies the default value of the attribute)
What are associations?
They describe dependencies and relationships between classes, thereby enabling cooperation between objects.
What are typical associations and what do they do?
- “has/knows” - expresses the fact that one class “has” or “knows” another class
- “consists of” - expresses the relationship in which a class is part of another class. It is used when class is a larger construct with elements that cannot be described using simple attributes
- “is a” - expresses the fact that a class A is a class B by type, but it has a more specific meaning and may have different attributes and methods than class B.
What are multiplicities?
They are quantity specifications for associations between classes. With multiplicities, you can specify how many objects of a class can be associated with how many objects of another class.
What is the Unified Modeling Language (UML)?
It is a graphic modeling language that was developed in the early 1990s with object orientation. UML now includes 13 different diagrams types for modeling different aspects of a system.
What are the different diagram types in the UML?
Structure Diagram: used for diagramming structure, elements and composition, as well as the interfaces of systems.
Behavior Diagram: used to model what happens in a system.
Class Diagram: used to model classes with their attributes, methods, and associations.
Object Diagram: used to model specific instances of classes, including concrete values as instances of classes.