1/104
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is the main gap that software design addresses?
The gap between requirements (what the system should do) and code (how the system fulfills requirements)
What is software design?
A creative process to transform user requirements into visualized form describing what and how the system will be developed; an iterative process translating requirements into a blueprint for constructing software code
What are the two main types of design artifacts in software design?
Conceptual Design (What) - meant for customers (UI designs, use-case diagrams); Technical Design (How) - meant for developers (structural models, behavioral models, architectural designs)
Why do we need software modeling?
To clarify and visualize software, specify behavior and structure, document development decisions, and facilitate communication between different users
What is the goal of software models?
To bridge the gap between requirements and code by documenting solutions to problems defined by requirements
What does UML stand for and when was it proposed?
Unified Modeling Language, proposed in 1995 to unify different modeling notations
What is UML?
A general purpose notation used to visualize, specify, construct and document artifacts of software-based systems, business processes, and similar processes
What are the two main ways UML is used?
As a blueprint (detailed plan) and as a sketch (draft or outline)
What characterizes UML as sketch?
Common in agile methods, used to discuss or document parts of design and code, lightweight and informal use of notation, goal is not to create complete blueprint-style model
What is forward engineering with UML sketches?
Using sketches to discuss alternative designs before any code is written
What is reverse engineering with UML sketches?
Using sketches to explain existing code in the context of software maintenance and evolution
What are the two main categories of UML diagrams?
Static Diagrams (model code's structure) and Dynamic Diagrams (model system's behavior at runtime)
What are the three UML diagrams covered in this lecture?
Use Case Diagrams, Class Diagrams, and Sequence Diagrams
What is a use case?
A specification of system behavior describing a set of sequences of actions, including variants, that a system performs to yield an observable result of value to an actor
What is an actor in UML?
An idealization of an external person, process, or thing interacting with a system, subsystem, or class; characterizes interactions that outside users may have with the system
What does a use case diagram specify?
The behavior of a system through sequences of actions to yield an observable result of value to an actor; captures intended behavior (the what) omitting implementation (the how)
What are the four elements of a use case diagram?
Systems, Actors, Use Cases, and Relationships
How is a system represented in a use case diagram?
As a rectangle with its name at the top (subject symbol) to indicate system boundary
How is an actor rendered in a use case diagram?
As a stick figure
What are the two types of actors in use case diagrams?
Primary Actors (initiate system use, placed on left side) and Secondary Actors (reactionary, system initiates interaction with them, placed on right side)
How is a use case depicted in a diagram?
As an oval shape with a unique label (usually starting with a verb) representing a high-level action/feature
What does an association relationship represent in use cases?
Bi-directional communication between the actor and the system; represented as a solid line drawn between an actor and a use case
What is generalization in use case diagrams?
Also called inheritance, shows specialized use cases from the general base case; depicted by an arrowed line (can apply to use cases or actors)
What does the <
A dotted line with arrow pointing to the include use case; occurs when a chunk of behavior is similar across more than one use case; used instead of copying behavior description
What does the <
A dotted line labeled <
When should you use <
Use <
What should each use case describe?
A significant chunk of system usage that is understandable by both domain experts and programmers
What should a use case diagram contain?
Only use cases at the same level of abstraction and only required actors
How should large numbers of use cases be organized?
Into packages
What does a class diagram describe?
Static structure showing the types of objects in a system and the relationships between them
What are the main elements of a class diagram?
Boxes (Classes with Attributes and Operations) and Relationships (Association, Generalization/Inheritance, Composition/Aggregation, Dependence)
What is a class in UML?
The most important building block of any object-oriented system; a description of a set of objects; an abstraction of entities existing in the problem/solution domain
How is a class depicted in UML?
As a class-box with up to three sections
For conceptual design, how can a class box be drawn?
With only two sections (without details)
What are attributes in a class diagram?
The adjectives and properties of a given entity; equivalent to instance variables in programming languages
What can be specified within the attributes section?
Visibility scope, type of the attribute, and default value
What are the four visibility scopes in UML?
What is the default visibility if no symbol is shown?
Usually private
How are static attributes represented in UML?
By underlining (e.g., num_users); these are global variables belonging to the class and shared between all objects of the same class
How are constant variables conventionally written?
In capital letters
How are computed/derived attributes indicated?
With a forward slash / before the attribute name (e.g., /age); indicates the attribute is computed during retrieval and not stored
What are operations and methods in UML?
Actions, functions or operations that can be performed by a given class
What can be specified for class operations?
Visibility modifier, operation name, passed parameters, and return type
Should setters and getters be added to UML class diagrams?
Better not; the aim of UML diagrams is to simplify and convey understanding of system design, not to care about non-architectural details
What is an interface in UML?
Composed of attributes and operations (signatures) that need to be implemented inside a class; drawn same way as class but with <
What must an interface have?
At least one class to implement its operations
What is the noun extraction heuristic for finding classes?
Each noun in the requirements text is a potential class or attribute (e.g., "User submits a form" → User, Form)e.g., "User submits a form" → User, Form)
What is the domain concepts heuristic?
Identify real-world entities the system must represent (e.g., Customer, Order, Invoice)
What is the responsibilities heuristic?
Look for entities that have behavior or store information (e.g., Payment handles processing)
What should you avoid when finding classes?
Functional concepts - ignore verbs, operations, or UI elements (e.g., Print, Click, Save)
How do you refine attributes when finding classes?
Some nouns are just attributes, not classes (e.g., "Student has a name" → name is an attribute)
How do you check for redundancy in classes?
Merge synonyms or overlapping concepts (e.g., Customer vs. Client)
In the example "A customer places an order that contains several items. The system calculates the total and generates an invoice," what are the resulting classes?
Customer, Order, Item, Invoice (drop System - too generic, Total - attribute)
What does a simple association represent?
A structural link between two classes; drawn as a simple line, optionally labeled with relationship name or roles the classes play
What can be added to improve readability of associations?
An arrow/triangle
What do multiplicity symbols represent?
The minimum and maximum times a class instance can be associated with the related class instance
What are common multiplicity notations?
___ (various options including: 1, 0..1, , 1.., 0..*, n..m for specific ranges)
What is an association class?
A class which associates to other classes when the relationship needs to have further attributes or information; linked to the association solid line by a dashed line; drawn as a normal class
When would you use an association class?
When the association needs further information (e.g., Student-School relationship needs registration year, academic year, status)
What does aggregation represent?
A logical "a-part-of" relationship between multiple classes or a class and itself
What does "logical" imply in aggregation?
Whole class can be removed without impacting the composing classes; composing classes can compose different whole classes at the same time (multiplicity can be *)
How is aggregation depicted?
___ (typically with a hollow diamond on the "whole" side)
What does inheritance or generalization show?
That one class (subclass) inherits from another class (superclass); properties and operations of the superclass are valid for objects of the subclass
How is generalization shown?
With a solid line from the subclass to the superclass and a hollow arrow pointing at the superclass
What is a dependency relationship?
A directed relationship showing that some UML element requires, needs or depends on other model elements for specification or implementation
When does a dependency exist?
If changes to the definition of one element may cause changes to the other (but not the other way around)
How is a dependency drawn?
As a dashed-line arrow (Class 1 depends on Class 2)
Do dependencies indicate multiplicity?
No, dependencies do not indicate any multiplicity
What does - mean in UML visibility?
Private
What does + mean in UML visibility?
Public
How is a simple association typically implemented in code?
As an instance variable/field in the class (e.g., Order has a Customer field)
How is a one-to-many association implemented?
Using a collection/list (e.g., Order has a List
How are bidirectional associations implemented?
Both classes have references to each other (e.g., Order has Customer, Customer has List
How is inheritance implemented in code?
Using the extends keyword (in Java) or similar inheritance syntax
How are dependencies typically represented in code?
As local variables, method parameters, or return types that are not stored as fields
What is the difference between <
What is the difference between association and dependency?
Association represents a structural relationship (usually stored as a field); dependency represents a weaker relationship (local variable, parameter) where changes to one may affect the other
What is the difference between aggregation and composition?
___ (Both are "part-of" relationships; composition is stronger - parts cannot exist without the whole; aggregation is weaker - parts can exist independently)
What is the difference between static and dynamic UML diagrams?
Static diagrams model code's structure; dynamic diagrams model system's behavior at runtime
What is the difference between conceptual design and technical design?
Conceptual design (What) is meant for customers (UI designs, use-case diagrams); technical design (How) is meant for developers (structural models, behavioral models)
What is the difference between forward and reverse engineering with UML?
Forward engineering uses sketches to discuss alternative designs before code is written; reverse engineering uses sketches to explain existing code during maintenance
When defining use cases in text, what should you do with nouns and verbs?
Use them accurately and consistently to help derive objects and messages for interaction diagrams
What should you do with common usages required by multiple use cases?
Factor them out; use <
What level of abstraction should use cases have in one diagram?
All use cases should be at the same level of abstraction
Why shouldn't you add getters and setters to UML class diagrams?
To simplify and convey understanding of system design without non-architectural details
What makes a good use case?
It describes a significant chunk of system usage understandable by both domain experts and programmers
How should you handle static attributes in UML?
Underline them and use capital letters for constant variables
What is the purpose of the / symbol before an attribute?
To indicate the attribute is computed/derived and not stored (e.g., /age)
True or False: A use case diagram should show implementation details of how the system works
False - use case diagrams capture intended behavior (the what) omitting implementation (the how)
True or False: Secondary actors are placed on the left side of a use case diagram
False - primary actors (who initiate) are on the left; secondary actors (reactionary) are on the right
True or False: All attributes without a visibility symbol are public by default
False - default is usually private
True or False: Dependencies indicate multiplicity like associations do
False - dependencies do not indicate any multiplicity
True or False: In aggregation, the whole class cannot be removed without impacting composing classes
False - in aggregation, the whole class can be removed without impacting the composing classes
True or False: UML sketches are only useful in forward engineering
False - UML sketches are useful in both forward engineering (before code) and reverse engineering (explaining existing code)
True or False: Every noun in requirements should become a class
False - some nouns are attributes, some are too generic (like "System"), and synonyms should be merged
If you see a dashed arrow from ClassA to ClassB in a class diagram, what does it mean?
ClassA depends on ClassB (changes to ClassB may cause changes to ClassA, but not the other way around)
If a use case diagram shows a dotted line from "Process Payment" to "Validate Card" with <
"Process Payment" requires and reuses the "Validate Card" behavior; it's a mandatory part of processing payment
You see an attribute written as "/age : int" in a class diagram. What does this mean?
Age is a computed/derived attribute that is calculated when retrieved, not stored in the database
A class diagram shows "Student -------- 0..* School" with a dashed line connecting to a box labeled "Enrollment". What is this?
An association class showing that the Student-School relationship has additional attributes (like registration year, status) stored in Enrollment
In a requirements document: "The manager approves a request submitted by an employee." Identify potential classes.
Manager, Request, Employee (drop "approves" and "submitted" - they are verbs/actions)