Java Reference


Object-Oriented Basics:

Objects have state and behaviour, modeled by class variables and methods that act on those class variables.

UML Diagrams:

UML class diagrams — unified modelling language — is a useful abstraction over object-oriented design for capturing the semantics of requirements. Before implementing a network of classes, we need to have a conceptual understanding/overview of the system

UML Examples:

Class:

Object:

Inheritance:

Association:

Aggregation:

Composition:


Aggregation vs. composition example:

A house contains exactly 1 kitchen, 1 bathroom, 1 mailbox, 1 or more bedrooms and at most 1 mortgage. When the house is destroyed, the mailbox can still exist.

Software Design Principles:

Design Smells:

Code Smells:

Coupling and Cohesion: