chapter 6 Flashcards
What is software design?
Software design involves specifying the structure of a software system without implementing the complete code.
The most common design approach is ________
Object-Oriented,
How is Object-Oriented structure is usually represented?
by Classes and by Class interactions
What does software design transition from _______ to ______ ?
- “what” the system must do to
- “how” the system will do it.
How are nouns and verbs utilized in the design process?
- Nouns are potential classes, objects, and fields [ student, grade, order, registration form ]
- verbs are potential methods or responsibilities of a class. [ register, encode grade, submit order ]
What do relationships between nouns in design signify?
Relationships between nouns in design represent potential interactions, such as containment, generalization, or dependence.
- Student registers for Course
- customer orders pizza
What questions does the design process aim to answer?
The design process seeks to answer questions like:
- Which nouns should be classes?
- Which ones become fields?
- What verbs should be methods?
- What interactions exist between classes?
What is CRC, and how is it used to identify classes?
CRC stands for Class-Responsibility-Collaborators.
It helps identify classes by creating cards where :
- the class name is on top,
- followed by responsibilities (problems to be solved) and
- collaborators (classes that receive messages).
What are the types of classes in CRC?
- Entity class
- Boundary class
- Control class
_______ is a.k.a domain class
Entity class
Entity class are the most important classes.
t
entity class exists in the ______
problem domain. E.g student, course
________ a class that exists on a system’s automation boundary [ web page, input window ]
Boundary class or view class
what is a Control class?
Is a class that mediates between boundary classes and entity classes, acting as a switchboard between the view layer and domain layer
_______ takes an event from boundary
class and calls the Entity class?
Control class
Why do we create CRCs for classes that collaborate with the primary object class?
To complete a use case, CRCs for collaborating classes are created by asking questions about their responsibilities and the information they need to fulfill those responsibilities.
_______ represents a collection of similar object in CRC?
A class
_______ is something that a class knows or does in CRC
responsibility
________ is another class that a class interacts with to fulfill its responsibilities in CRC?
collaborator
What is the purpose of noun analysis from requirements?
Noun analysis from requirements helps identify essential elements in a system by focusing on nouns and their attributes.
UNIVERSITY
- have records of student and staff
- records = id, name, # no, …
- Subjects
- Salary …
What is A UML class diagram?
A picture that Shows classes and relationships among them.
What elements are Not represented in a UML class diagram?
– details of how the classes interact with each other
– algorithmic details; how a particular behavior is implemented
What is meant by flexibility in UML class diagrams?
- Same class can be modeled in 4 different ways:
– With no attributes or operations shown
– With only the attributes shown
– With only the operations shown
– With both the attributes and operations shown
______ is always the first component of the class box
The name of the class
_______ is a property of a class
Attribute
Circle (centreX, centreY)
_________ is sth that a class can do?
operation
______ begins below a line separating them from class name and ______ below a line separating them from the attributes?
- attributes
- operations
_______ specifies the extent to which other classes can use a given class’s attributes or operations?
Visibility
What are the Three levels of visibility?
*public level
*protected level
*private level
In _________ level is usability open only to classes that inherit from original class?
protected
What does class multiplicity specify in a class?
Class multiplicity specifies the number of instances (objects) of that class that can exist simultaneously.
What are the different types of relationships between classes?
- Association (delegation),
- Generalization (inheritance),
- Realization (interfaces),
- Dependency.
How is Association represented between classes?
Association is a link.
- represented by a solid line between classes, with an example being “A Person works for a Company.”
What are Association Properties?
- Name – Name of the association
- Role – The specific role of the association
- employee | employer
- Multiplicity – Indicates the number of objects that are connected
- Type – Plain association, aggregation, composition
- Direction – Direction can also be shown for a association
How is Multiplicity used in Association?
specify the number of links that can exist between instances (objects) of the associated classes.
Multiplicity can be expressed as?
- Exactly one - 1
- Zero or one - 0..1
- Many - 0..* or *
- One or more - 1..*
- Exact Number - e.g. 3..4 or 6
- Or a complex relationship – e.g. 0..1, 3..4, 6..* would mean
any number of objects other than 2 or 5
An association that connects a class to itself is
called a _________
self association.
what are the 2 types of association?
- aggregation
- composition
explain aggregation.
- “is part of” / “Has a”
■ Unidirectional/not vice versa - clear white diamond
- collage | teacher
explain composition.
- “is entirely made of“ / “Contained”
■ stronger version of aggregation
■ the parts live and die with the whole
■ black diamond - book | page
explain Generalization (Inheritance).
- Child class is a special case of the parent class
- Animal [cat , dog ]
Inheritance - Implementation?
public class Animal {
}
public class Cat extends Animal {
}
public class Dog extends Animal {
}
The relationship between a class and an interface is called ________
realization
explain an interface.
- Interface is a class with no attributes, only method signatures
- «interface» Animal
- getSound()
■ Classes can implement the methods
■ Relationship Represented by a dashed, white arrow
What is Dependency?
- Explains that Change in specification of one class can change the other class
- can also be used to show relationships between classes and objects.
______ classes are left out from UML class diagram since Including them makes the diagram complex?
Boundary classes