University of Oxford Logo University of OxfordSoftware Engineering - Home
On Facebook
Facebook
Follow us on twitter
Twitter
Linked in
Linked in
Google plus
Google plus
Digg
Digg
Pinterest
Pinterest
Stumble Upon
Stumble Upon

Object-Oriented Programming

This module teaches the principles of object-oriented and type-driven programming. The language used in this module is TypeScript, but the majority of concepts covered will apply just as well to other object-oriented languages. For a detailed description of the topics that will be covered, please refer to the Contents section below.

Frequency:This course normally runs three times a year.

Course dates

Future courses are expected, but yet to be scheduled.

Objectives

On completion, you will be able to design and implement solutions to real-world programming tasks using object-oriented principles and techniques, in TypeScript.

Contents

Pre-study

The following material is covered in the pre-study for this module. You will receive three packs of slides and some associated exercises: you should ensure that you understand the material and complete the exercises before the start of the teaching week.

A Q&A will be held on Monday morning to clarify any outstanding points, but the teaching materials otherwise take the pre-study material for understood. In particular, it is presumed that you are able to write, compile and execute TypeScript code. If you plan to use your machine for practical exercises, please make sure that it is set up before the start of the teaching week.

  • Basic Types: How to structure code in TypeScript: basic setup, basic syntax. Brief overview of basic types: booleans, numbers, bigints, strings. Union types, intersection types, the type hierarchy. Static vs runtime type-checking in TypeScript.
  • Arrays and Functions: Arrays and their operations. Function declarations, optional parameters, rest parameters. Destructuring syntax for arrays.

Teaching Week

The following material is covered in detail during the teaching week:

  • Objects: Object literals as carriers of data. Object literal types, structural typing. Optional properties, destructuring syntax for objects. Classes, instance properties and methods. The prototype mechanism in JavaScript. Static properties and methods. Getters and setters.
  • SOLID Principles: Single-responsibility principle, encapsulation, access modifiers, readonly arrays and index signatures. Open-closed principle, class extension, abstract classes, composition over inheritance. The prototype chain in JavaScript. Liskov substitution principle. Dependency-inversion principle, interface implementation, interface segregation principle, interface extension.
  • Object-Oriented Patterns: Mini-project, followed by model solution displaying various OO patterns: facade, visitor, factory, singleton, flyweight, publish-subscribe, builder, state, prototype, memento, fluent interface, companion object, lazy evaluation.
  • Advanced Types: Function overloading, call signatures. Tagged unions. Generics. Key-in types. Mapped types. Conditional types.

 

Requirements

Solid experience with imperative programming is a prerequisite for this course. Familiarity with object-oriented concepts (e.g. classes, inheritance, polymorphism) is desirable.