Back to marketplace

Section 12 Chapter 68 - Object Oriented Design Principles

No description yet. This curated deck is ready for daily study.

Total cards: 14•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (14)

#1
Front (Question)

Aggregation

Back (Answer)

Occurs when a class is a container of other classes but these contained classes can exist without their container. The container is said to be an aggregation of its contained objects

#2
Front (Question)

Composition

Back (Answer)

Occurs when a class is a container of other classes and these contained objects cannot exist without their container. If the container is destroyed then so are all the objects contained in it. The container is said to be a composition of its contained objects

#3
Front (Question)

UML symbol for aggregation

Back (Answer)

Line between two objects with a white diamond at the container

#4
Front (Question)

UML symbol for composition

Back (Answer)

Line between two objects with a black diamond at the container

#5
Front (Question)

Polymorphism

Back (Answer)

A pattern in OOP where classes can have different functionality while sharing a common interface, commonly achieved by child classes overriding the methods of their super class. It can also be described as the ability of a programming language to process objects differently depending on their class

#6
Front (Question)

Overriding

Back (Answer)

Defining a method with the same name and arguments as that of a method in the parent class, when the class in question inherits from the parent class. If the method of this name is called from an instance of the child class, the code for the overriding method will be executed rather than the code of the parents method

#7
Front (Question)

Why OOP is used (6)

Back (Answer)

• Forces designers to go through more extensive planning • Due to encapsulation, individual classes can be tested independently • Abstraction: Once a class is created the knowledge of how it is exactly implemented is not needed • New objects can be created without affecting old ones • Re usability since basic objects (such as a graph or a tree) can be used for many different things • Easier to maintain as errors tend to be more localised

#8
Front (Question)

“Favour composition over inheritance”

Back (Answer)

Composition is generally preferred to inheritance since it allows greater flexibility, since composition is a less rigid relationship. For instance if classes B and C both inherit from class A, it would then not be possible to create a class D which is a combination of classes B and C using only inheritance

#9
Front (Question)

“Programming to an interface”

Back (Answer)

In the case that many, often unrelated, classes need to be able to respond to the same messages it can be useful to implement an interface. An interface is a collection of abstract methods that classes can implement and then define appropriately. Polymorphism can be used in this case since all these classes will have a common set of methods.

#10
Front (Question)

“Encapsulate what varies”

Back (Answer)

A strategy used to reduce maintenance. When something changes in a program (for instance in different specifications) the part that changes should be encapsulated so that only the inner workings of that part of the program need to change and not the rest of the program and how they communicate.

#11
Front (Question)

Class diagram sign for public

Back (Answer)

+

#12
Front (Question)

Class diagram sign for private

Back (Answer)

-

#13
Front (Question)

Class diagram sign for protected

Back (Answer)

#

#14
Front (Question)

How a class in a class diagram is set out

Back (Answer)

Name Attributes Methods