0% found this document useful (0 votes)
3 views8 pages

1.2.1 Objects and Classes

The document discusses the concepts of objects and classes in software construction, architecture, and engineering. An object is defined as a software machine that allows access and modification of data, while a class describes a set of possible run-time objects sharing the same features. The text emphasizes the distinction between classes, which exist in the software text, and objects, which exist during program execution.

Uploaded by

Salem Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

1.2.1 Objects and Classes

The document discusses the concepts of objects and classes in software construction, architecture, and engineering. An object is defined as a software machine that allows access and modification of data, while a class describes a set of possible run-time objects sharing the same features. The text emphasizes the distinction between classes, which exist in the software text, and objects, which exist during program execution.

Uploaded by

Salem Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

SCAE: Software Construction,

Architecture, and
Engineering
Objects and classes

Bertrand Meyer
sit.org © Schaffhausen Institute of Technology
Objects and classes
An object is a software machine allowing program
elements to access and modify a collection of data

Example objects may represent:


 A city
 An element of the GUI such as a button

Each object belongs to a certain class, defining the applicable


operations, or features

Examples:
 The class of all cities
 The class of all buttons

2
Definition: class

Class

A class is the description of a set of possible


run-time objects to which the same features
are applicable

A class represents a category of things

An object represents one of these


things
3
Definitions: class, instance, generating class

Instance, generating class


If an object O is one of the objects described by a class
C:
 O is an instance of C
 C is the generating class of O

A class represents a category of things

An object represents one of these


things
4
Objects vs. classes
Classes exist only in the software text:
 Defined by class text
 Describe properties of associated instances

Objects exist only during execution:


 Visible in program text through names denoting
run-time objects

Examples: Zurich, Line8

5
What is an object?
Software notion: machine known through operations applicable to it.
Three kinds of object:
“Physical objects”: reflect material objects of the modeled world or
system
Examples: the Louvre, Paris, a metro car..
“Abstract objects”: describe abstract notions from modeled world or

system
Examples: a line, a route...
“Software objects”: represent pure software notions

Examples: “data structures” such as arrays or lists


A key attraction of object technology is its modeling power: connect
software objects to objects of the problem domain (“model”)
You should not, however, confuse them 6
Software construction
Finding appropriate classes is a central part of
software design

(the development of the architecture of a program)

Writing down the details is part of implementation

7
What we have seen in 1.2.1:

Every object is an instance of a class


Class: the basic unit of program texts
Object: the basic unit of program execution
Static vs dynamic views

You might also like