






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to Object-Oriented Programming (OOP), focusing on key concepts such as abstraction, encapsulation, inheritance, and polymorphism. OOP is a programming paradigm that uses objects and classes to represent data and functionality. Abstraction is the process of exposing only relevant information to the user, while encapsulation ensures that data is hidden and protected. Inheritance allows creating new classes based on existing ones, and polymorphism enables objects of different classes to be treated as objects of a common superclass. The document also discusses design issues and the application of OOP in languages like C++ and Java.
Typology: Summaries
1 / 11
This page cannot be seen from the preview
Don't miss anything!







of an entity that includes only the attributesof significance in a particular context.”~Sebesta, pg. 434– Process abstraction– Data abstraction
is no longer sufficient to organize largeprograms
into logically related processes and data
separately or independently compilableunit
encapsulation containing the datarepresentation and methods for
one
specific data type.
-^
An abstract data type is a data type that satisfiesthe following two conditions:– The representation, or definition, of the type and the
operations on objects of the type are contained in asingle syntactic unit. Also, other program units maybe allowed to create variables of the defined type.
from the program units that use the type, so the onlydirect operations possible on those objects are thoseprovided in the type’s definition.
units.
creating interface ‘boundaries’ –enhancing modification and reuse.
‘hidden’.
encapsulation of type definition andmethods
definitions
objects
hierarchies
more than one type– e.g. if B is a derived Class of Class A, and
variable x has type A, x can hold a value oftype B as well
more difficult; requires more caution atruntime
-^
“An executing program in an object-orientedlanguage can be described as a simulation of acollection of computers that communicate witheach other through messages.” (Sebesta p. 463)
-^
Invoking the method of a class is ‘sending amessage’
-^
Collection of methods define a ‘messageprotocol’
-^
Identify the objects and interactions in yourproblem, and simulate them
add object model
scalar types
whether a subclass inherits all entities ofthe parent class– Where entities are overriden, they should be
compatible
the subclass
are available to the subclass
Binding
methods, objects, and message passing
support for:– Abstract Data Types (classes)– Inheritance (single, with some extensions)– Polymorphism
byte code
Machine (JVM)
on any JVM
recycled automatically
documenting code:– A simple markup language for use in source
code, which allows embedded html
creates easy to read html Classdocumentation.
Class hierarchy– Integer, Double, …
exceptions
are Classes– Predefined– User defined
thrown
by a method, or
caught
and
handled
it possible to tightly control access tomachine resources– Disk– Network– …
code
files
multi-threaded programs, and managingconcurrency.– Thread Class– Low-level synchronization primitives
references
to Class instances