Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 4: Object-Oriented Paradigm - Coggle Diagram
Chapter 4:
Object-Oriented Paradigm
Overview
Encapsulation
Inheritance
Polymorphism
Introducing the Object-Oriented Paradigm
Classes and Objects
class
groups together related data and their operations
object
an
instance of a class
Relationships
Composition
the whole/part relationship between classes
Aggregation
A similar but more relaxed compositional relationship is called aggregation
Association
the logical relationship among classes
Inheritance
In an OO design, very often two or more classes may have a large set of attributes and operations in common
Composition vs. Inheritance
Use the inheritance relationship only when the derived class "is-a"
base class
Composition (or aggregation) can be used to model the "has-a"
relationship among classes
00 Analysis
Step 1: Design of a UML Use Case Diagram
Step 2: Develop an Analysis Class Diagram via Noun Extraction
OO Design
Step 1: Identify Classes—CRC Card
Step 2: Construct an Interaction Diagram
Step 3: Build a State Machine Diagram
Step 4: Class Specification
Design Principles
Principle of Decoupling
Less interdependency
Easy extension
Simplicity and elegance in implementation
Ensuring Cohesion
Open-Closed Principle
Open to extension
Closed to modification
Separate interface and implementation
Keep attributes private
Minimize the use of global variables