OOP Review
OOP Review
CS 124
Object-Oriented Programming
Revisited
Key OOP Concepts
Object, Class
Instantiation, Constructors
Encapsulation
Inheritance and Subclasses
Abstraction
Reuse
Polymorphism, Dynamic Binding
Object-Oriented Design and Modeling
Object
Definition: a thing that has identity, state, and
behavior
0..1 0..3
Borrower Book
currBorr bk[]
Facilitate Checkout
Librarian Borrower
Search for Book
Facilitate Return
Example:
Interaction Diagram
2: isAvailable()
Checkout
:Book
Screen
1: borrowAllowed()
3: borrowBook()
4: setBorrower()
:Borrower
Example:
State Diagram (Book)
start
Reserved
New Borrowed
Delivery info
Accept and Post
Delivery
Transaction
Item Master
OO Counterpart:
Object Interaction
new (delivery info)
Encoder :Transaction
:Item Master
Building an
OO Dynamic Model
Identify use cases
Describe each use case through an
interaction diagram
For more complex objects, provide a state
diagram per class
Derive implied methods (and attributes)
What’s Next?
Need to understand the notation
Make sure it helps the software development
process
When to use the UML techniques
Primarily when specifying OO design
Formal means of communication across the
different software development stages