Intermediate OOP Concepts

IS-A, HAS-A, and USES-A relationships: Inheritance, Composition, Aggregation, and Association

Class-Level Relationships Instance-Level Relationships

REFERENCE: Basic UML Class Diagram Cheat-Sheet

Here are the UML diagram representations of these various OOP relationships: http://creately.com/blog/diagrams/class-diagram-relationships/
UML for OOP Relationships

Java and OOP

Java is not truly object-oriented as it has primitive types and does not support the fact that all operations must be performed by sending messages to objects (e.g., it has static methods you can call without an object and operator overloading for string concatenation uses StringBuilder).

A Pure/Complete/Fully Object Oriented Language is one that supports or has features which treats everything inside program as objects. It doesn't support primitive datatypes like int, char, float, bool, etc. There are seven qualities to be satisfied for a programming language to be purely object oriented, like Smalltalk:

  1. Encapsulation/Data Hiding
  2. Inheritance
  3. Polymorphism
  4. Abstraction
  5. All predefined types are objects
  6. All user defined types are objects
  7. All operations performed on objects must be only through methods exposed at the objects.

Source: https://www.geeksforgeeks.org/java-not-purely-object-oriented-language/ and https://stackoverflow.com/questions/11408427/how-does-the-string-class-override-the-operator

Miscellaneous UML Notes

UML stands for Unified Modeling Language. It is a visual model to represent your program. It helps readability and understanding of what your program does, such that even someone that does not know Java or C++ can look at your UML and get an understanding of what is going on. UML is a diagrammatic language and has become the standard way to draw software. For those of you that need a refresher in this the link below will help.

http://www.csci.csusb.edu/dick/cs201/uml.html

This link below is an advertisement for a class that offers UML teaching but page 2 onwards offers some good graphics of basic UML as well as how it appears in Java code.

http://www.parlezuml.com/tutorials/umlforjava/java_class_basic.pdf


Ricky J. Sethi, PhD <rickys@sethi.org>
Last updated: Friday, June 15 2018
(www.sethi.org/tutorials/notes_oop.shtml)