Lecture 8 Flashcards
What is a structural model?
Capture the structure of a system. Elements and their connection can be perceived even without executing the system
Software modeling helps in establishing what?
The context and (intended) functionality of a system
What are the steps of relevance of modeling in software development.
Analysis: Use uniform notation for use cases, unify terminology.
System Design: Create coarse-grain system structure, abstract for decision-making.
Detailed Design: Develop fine-grain system design, specify and agree on behavior.
Implementation: Models as implementation specs.
Quality Assurance: Ensure implementation matches models, use for testing behavior.
Maintenance: Evaluate changes based on model feasibility/effort.
what should models abstract from?
Details and instead focus on the “design essence” of the system
Which UML (unified modeling language) diagrams are structured?
Class diagram
Object diagram
Deployment diagram
What does UML stand for?
The Unified Modeling Language (UML)
Mention the main diagram types of the UML.
Structure diagram
Behaviour diagram
(Interaction diagram)Her
How would you describe the process of creating an UML class diagram?
Purpose: Create a general software system design focusing on essential problem-solving.
Process: Start with a high-level design, refine to detailed implementation.
Focus: Abstract technical details to prevent getting lost in technology discussions, emphasizing domain challenges
What is UML?
- Standard defining meta model for software modeling
- Standard specifying model concepts and their relations
What the UML is not:
- A graphical language standard (only suggestions)
- A model with formal semantics (instead interpretation using common sense)
What is meta model?
A meta model captures the syntactic elements and their potential relations. You can think of this as the blueprint of a language that tells you which concepts can be expressed
(vocabulary) and in which way they may be combined (grammar).
What are the three visibility modifiers, and their symbols?
Protected #
Private -
Public +
What is an association, association class and association name in UML class diagram?
Association: Reference to another class’
objects.
Association class: Additional information for association
Association name: In middle of association, and is in the reading direction
her
What is a Class Member? How is that declared?
- Underlined
- Same value/declaration for all objects of class
- Similar to static in Java
How do you write attributes, methods and parameters in an UML class diagram?
vis.mod = visibility modifer
Attributes: vis.mod. <name> : <type>
Methods: vis.mod. <name>() : <type>
vis.mod. <name>(<parameters>) : <type>
Parameters: Similar to attribute
Is it okay to omit visibility modifiers/types/names?
Yes, class diagrams provide a lot of liberty in regard to providing names, types, visibility modifiers: eg, visibility modifiers or types may be omited altogether for early design phases
What is an multiplicity in UML class diagram?
Lower bound, e.g., 0 or 1
Upper bound, e.g., 5 or *
(remember ER diagrams in databases)
Her
Write down the diagram type, modeling of, purpose and benefits of an UML class diagram
Diagram type: Structual diagram
Modeling of: classes, interfaces, relations
Purpose: Abstraction from, so individual objects via classes and details for design
Benefits: Modeling a subsystem for analysis and design. Reverse engineering existing system design for overview
her
What kind of relationship does aggregation imply?
a relationship where the child can exist independently of the parent (unlike composition). Example: Lecture (parent) and Student (child). When you delete the Lecture, the Students still exist.
What is association, aggregation and composition in UML class diagram?
Association: References
Aggregation: owns but does not manage lifecycle
Composition: own and managaes lifecycle
her
What is a composition in regards to class diagrams? What does it look like?
A composition is a special case of an association. A composition means that objects of the referenced class are “owned”. (unlike plain associaions but similar to aggregation).
It looks like a filled diamond on a line with an arrow in the other end.
What are interfaces, enumerations and stereotypes in UML class diagram?
Interface: <<interface>>
(written using stereotypes («») (DRAWN WITH DASHED LINE, IMPLEMENTS)
Enumeration: <<enumeration>>
(written using stereotypes («»)
Stereotype: Written using «»
Her
What kind of relationship does compositon imply?
A composition means that the referenced object is “part-of” the referencing object (unlike
aggregation). In other terms, the referencing object manages the lifecycle of the referenced object.)
How does generalisation look like in an UML class diagram?
How does he UML Generalization denotes inheritance?
Generalization (super class) and specialization (sub class)
Difference between classes and objects (UML diagrams) and how to draw?
Class: Description of similar elements. Object is an instance of a class
Object: Concrete, individual element. Maintains (unchangeable) identity after creation
Her
How does class diagrams denote abstract methods/classes?
Writng them in italics.
However, for hand-drawn UML diagrams, this is somewhat impractical because it is hard
to distinguish italics in hand-writing. In such a case, , it may be helpful to add a comment stating that the respective element is abstract.
Difference between UML and Java (protected visbility, inheritance, association type, association classes)
UML
Protected visbility: Visible only for class and subclasses
Inheritance: Multiple
Association types: Association, Aggregation, Composition
Association classes: Directly supported
Java:
Protected visbility: Visible for class, subclasses
and same package
Inheritance: Single
Association type: Reference
Association class: Need to be emulated
What phases are likely to yield what diagrams?
Analysis (requirement engineering) = use case diagram
Coarse-Grain Design and fine grain = class diagram
implementation = code
Write down the diagram type, modeling of, purpose and benefits of an UML deployment diagram
Diagram type: Structual diagram
Modeling of: physical deployment of
artifacts on nodes
Purpose: Show which parts of a distributed application run on which parts of
the infrastructure.
Benefits: Specify distribution of software. Determine necessary hardware infrastructure. Devise communication strategies
her
Difference in fine-grain and coarse-grain desing?
Coarse-grain class design may be relatively informal: Names may be informal in syntax. Types may be omited, esp. the (technical) return type void.
Fine-grain class design has to be specific so that it can serve as basis for implementation.
What is an artifact in UML deployment diagram?
Artifact: A piece of software (component, object, document, etc,)
It’s deployed to nodes
Her
Draw a UML program for this:
Here
Name these things:
Characteristics of object diagrams:
Structural Diagram, models objects (class instances), show example of objects with their specific values.
Good for:
- Talk about system states with
concrete values for objects. - Integrate with behavioral
notations that explain system
execution via examples.
Draw a simple object diagram
Is the name of an object mandatory (object diagram)?
No, an anonymous object can be
displayed instead, e.g., “:Engine”.
What does a node describe in deployment diagrams?
An “instances” of specific pieces of hardware, e.g., a web server, a laptop or a database server.
Nodes may have attributes (RAM ect) and nodes can be nested. (sub-nodes)
Take home message:
- UML Class Diagrams: Fine-grained specification of system structure.
- UML Object Diagrams: Example of system state via
instances - UML Deployment Diagrams: Distribution to physical
components.
What is an aggregation in regards to class diagrams? What does it look like?
An aggregation is a special case of an association. An aggregation means that objects of the referenced class are “owned” (unlike plainassociations but similar to composition).
It looks like a empty diamond on a line with an arrow in the other end