Please enable JavaScript.
Coggle requires JavaScript to display documents.
OO Design - Coggle Diagram
OO Design
Step 4: Class Specification
Identify the public interface of the class
attributes
operations
A class provides four categories of operations in its public interface
constructor operations
is used to initialize the data members of an object
when it is created
destructor operations
is used to clean up memory and free system
resources when an object is no longer in use
accessor operations
retrieves information from the object
mutator operations
resets the value of one or more object attributes
Two important problems
must be addressed for each operation
What parameters are needed to
invoke the operation?
What should be the return value?
Step 3: Build a State Machine Diagram
Describe the life-cycle of an object
A state machine diagram consists of two types of basic elements
state
which is represented using a rounded rectangle
transition
which is
a directed arc between states
There are two cases of building a state
machine diagram
When a class is responsible for a single use case, designers simply look into the flow of events and corresponding interaction diagram to identify the different states that an object of this class goes through and the corresponding transitions.
When a class is involved in multiple use cases, designers have to combine all the information and consider the environment and the change of internal data values to identify the states. Sometimes, when a state machine diagram is too complex, you can take advantage of the substate utility included in UML 2
Step 1: Identify Classes—CRC Card
An analysis class diagram presents an abstract logical structure of the system
What is CRC modeling
Approach to identify classes and assign them responsibilities
CRC card
consists of three sections
Class name
Responsibility
Collaborator
Three types of participants play CRC cards
domain users
the experts in the business model
OO design analysts
the ones who know OO modeling well and are responsible for filling out the contents of the cards
facilitators
is in charge of explaining the session rules and moving the discussion session forward
Step 2: Construct an Interaction Diagram
An interaction diagram describes how the objects that compose the system interact with one another to accomplish a use case
UML provides two popular forms of interaction diagrams
sequence diagrams
communication diagrams