Object-oriented Programming (OOP)


So far, we have been doing what is called Imperative Programming and Procedural Programming. This is where we type a series of commands (imperative = issuing commands), and where we create procedures (functions) to separate our code to make it easier to manage and also to make it reusable.

This week, we investigate Object-oriented Design and Object-oriented Programming. In Object-oriented Programming, we go further than just separating our code into functions: we think in terms of classes of object and collect all of the data and functionality together within the classes.

image

Example class hierarchy diagram, with a Python implementation of a class.






Click here to go to the COMP16321 Blackboard page


Click anywhere to close this video

Contents



Introduction

Task 1 – UML Class Diagram

Task 2 – Private Attributes

Task 3 - Inheritance

Task 4 - Object-oriented Design

Conclusion


Green = Current Page

Click anywhere to close this overlay

Topics Covered in this Lab



1. UML Class Diagram

2. Python Classes

3. Public/Private

4. __dir__()

5. Properties

6. Getters and Setters

7. Inheritance

8. Overriding

9. Object-oriented Design



Click anywhere to close this overlay

Lab Key



Notes – #FF6F61

Videos – #34568B

Code Examples – #009B77

Downloads - #C3447A

Internal Link (University Resources) – #955251

External Link (Non-University Resources)– #EFC050

Other - #660099



Click anywhere to close this overlay