A real-world entity is anything that exists in the physical world and can be identified as a distinct object.

Examples include:

  • People: Like you, your friends, or family members.
  • Animals: Such as dogs, cats, or birds.
  • Objects: Like cars, books, or buildings.
  • Places: Such as cities, parks, or countries.

In the context of Object-Oriented Programming (OOP), these real-world entities are modelled as objects, with attributes and methods that represent their properties and behaviors.

In OOP an object is like a real-world entity that has two main characteristics:

  1. Attributes: These are the properties or data that describe the object. For example, if you have an object representing a car, attributes might include its color, make, model, and year.
  2. Methods: These are the actions or behaviors that the object can perform. Continuing with the car example, methods might include starting the engine, accelerating, or braking.

Think of an object as a combination of data (attributes) and functions (methods) that work together. Objects are instances of classes, which are like blueprints that define the structure and behavior of the objects.

For example, take a pen:

  • A pen has properties such as the ink colour, the colour of the casing, the type of nib, the type of ink etc.
  • A pen has things it can do such as when the nib comes into contact with a surface and some pressure is applied to it onto the surface, ink will be transferred from the pen to the surface.
  • We interact with a pen by picking it up, holding, putting it in a pencil case, writing with it etc.

Classes and Objects

In Object-Oriented Programming (OOP), entities are represented as objects.

We can think of an object as a combination of data (attributes) and functions (methods) that work together.

A class serves as a blueprint or template for creating objects.

For example, a Shape class might have attributes like line color and fill colour,and methods like draw() and move().

An object is an instance of a class.

Drawing Shapes

In this tutorial, we will use several classes. these are nomrally shown in a Class Diagram with attributes and methods clearly defined.

logo




This is a development site to gather together teaching materials for AQA A Level Computer Science. It will be changing and being remodelled throughout this year.

No data is stored on the site but cookies are used to enable the website to function properly.

© 2025 Jay Patel - Dixons Sixth Form Academy, Bradford

Contact: jpatel@dixons6a.com