Domain Class
Definition: Classes are things we want to know about & keep track of within the problem domain. Problem domain is the area of the user's business within the scope of the system or application. e.g. Nationwide -- insurance domain.
2 types of things
- Tangible -- can see and touch
- Intangible -- just concept
How to find Classes?
- Look for objects and things in our system -- e.g. things associated with each Use Case/ User Story
- Look for nouns in our solutions -- e.g. All nouns associated with actors, Use Case/ User Story, Input/Output
Noun Technique
- Should I include it?
- Unique noun
- Within system scope
- System needs to remember one or more of the noun items
- Should I exclude it?
- Synonym of something already defined
- Just an output from something already defined
- Just an input that leads to something already defined
- Should I research it?
Data-driven Technique
Identify the data in the system and divide it up into classes
- Start by looking at the database
- Then, understand the data and put them into logical groups (classes)
Responsibility-driven Technique
Identify all the responsibilities (methods) in the system
Class Relationship
- Definition: Naturally occurring associations among specific things
- Can occur in both directions
- Optional relationship: multiplicity/cardinality is 0+
- Mandatory relationship
- multiplicity/cardinality is 1 to 1
- multiplicity/cardinality is 1+
Attributes
Things have attributes (descriptive information about our things) and values
Things
Things are nouns. All actors and objects in the system are called things.
Actors
Actors can be a external role played by a physical person OR an external system
Object
Objects are the internal artifacts of a computer system.
- Have attributes and behavior
- Type of thing is called a class, specific thing is an object
- Objects belong to classes
- Behaviors of objects are called methods
Analysis Model
- Class diagrams model the problem domain objects and describes the information about things
- Use Cases, Activity Diagrams, and System Sequence Diagrams describe the information about the business processes
Design Model
Communication Diagrams, Sequence Diagrams and CRC Cards describe the flow of execution, how user interact with the problem domain objects.
CRC
Class Responsibilities Collaborators
- One CRC card for each class (in class diagram)
- Identify the class and its responsibilities -- i.e. methods
- Identify collaborator classes -- e.g. include
- NO universally accepted syntax
Object Speak
- Who are you? (class)
- What do you know? (attributes)
- What can you do? (responsibilities/methods)
Collaboration
Definition: This class has a responsibility to fulfill, but does not have enough information to do it. This is when collaboration comes in -- 2 forms
- Request for information
- Request to perform a task
How to create CRC card?
- Identify classes with Noun Technique or Data Driven Technique -- Who are you?
- Identify responsibilities by Verb Technique or Responsibility Driven Technique -- What do you do?
- Identify collaborators by asking "Does the class have the ability to fulfill this responsibility?"
- Identify attributes by asking -- What do you know?
- Structural diagrams describe Things -- Class, statechart etc.
- Behavioral diagrams describe Events -- Use case, Sequence, Collaboration, etc.