Imperative Programming HT23, Object-oriented programming


Flashcards

@Describe the idea of modularisation in object-oriented programming.

All functionality and data of a “thing” are held in one place.

@Describe the idea of abstraction in object-oriented programming.

Functionality is specified in its more general form, free from any implementation details.

@Describe the idea of encapsulation in object-oriented programming.

Implementation details are hidden from the caller.

@Define an object in object-oriented programming.

A software artefact with some data, and some operations on that data.

@Define a class in object-oriented programming.

A template for objects.

Say you have a trait Book and want to define a class MapBook that extends it. How do you do this in Scala?

class MapBook extends Book { ... }