Podcast
Questions and Answers
What is the focus of object design?
What is the focus of object design?
What are the two types of responsibilities in object design?
What are the two types of responsibilities in object design?
When are responsibilities assigned to classes?
When are responsibilities assigned to classes?
How are responsibilities related to 'knowing' often inferred?
How are responsibilities related to 'knowing' often inferred?
Signup and view all the answers
What is an example of a 'doing' responsibility?
What is an example of a 'doing' responsibility?
Signup and view all the answers
Study Notes
Object Design Focus
- The focus of object design is on defining the responsibilities of objects, which are the actions that an object should perform.
Types of Responsibilities
- There are two types of responsibilities in object design: knowing responsibilities and doing responsibilities.
- Knowing responsibilities refer to the information that an object should maintain, such as its state or attributes.
- Doing responsibilities refer to the actions that an object should perform, such as calculations or operations.
Assigning Responsibilities
- Responsibilities are assigned to classes when the class is defined, as it determines the behavior and properties of the objects created from it.
Knowing Responsibilities
- Knowing responsibilities are often inferred by considering what information an object should have or maintain.
Doing Responsibilities
- An example of a doing responsibility is a
BankAccount
object performing a withdrawal operation.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn about designing objects with responsibilities and methods, and how to identify classes and objects in object design. Understand the obligations and behavior of an object in terms of its responsibilities.