0% found this document useful (0 votes)
6 views

OOPM Programming Languages and Oo Model.pptx

The document provides an overview of programming languages, detailing their evolution from machine language in the 1940s to object-oriented programming concepts. It discusses the characteristics, advantages, and disadvantages of various generations of programming languages, including machine, assembly, and high-level languages. Additionally, it outlines key principles of object-oriented systems such as abstraction, encapsulation, modularity, hierarchy, typing, concurrency, and persistence.

Uploaded by

meenalsaxena.es
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

OOPM Programming Languages and Oo Model.pptx

The document provides an overview of programming languages, detailing their evolution from machine language in the 1940s to object-oriented programming concepts. It discusses the characteristics, advantages, and disadvantages of various generations of programming languages, including machine, assembly, and high-level languages. Additionally, it outlines key principles of object-oriented systems such as abstraction, encapsulation, modularity, hierarchy, typing, concurrency, and persistence.

Uploaded by

meenalsaxena.es
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Programming Languages

•Language used to communicate to computers.


•Programming Language is a formal computer language
designed to communicate instructions to a machine,
particularly a computer.
•Programming languages can be used to create
programs or algorithms to control the behaviour of a
machine
History
st
1 generation programming languages
• Introduced in the 1940’s.
• Sometimes referred as binary language, Machine language,very low
level language, machine code.
• Made of entirely 1s and 0s.
• Programmers have to design their code by hand then tranfer it to a
computer by using a punch card, punch tape.
• It is the only language a computer is capable of understanding
without using a translation program.
•Close to machines.
•Modern day programmers still occasionally use machine level
code, especially when programming lower level functions of
the system, such as drivers, interfaces and hardware devices.
•Advantages—
•Machine language makes fast and efficient use of the
computer.
•It requires no translator to translate the code. It is directly
understand by the computer
•Disadvatages-
•All operations codes have to be remembered.
•All memory addresses have to be remembered.
•It is hard to find errors in a program written in the machine
language.
nd
2 generation programming languages
• Introduced in the 1950’s.
• Referred as assembly language or low level language.
• Programmes are in the form of alphanumeric symbols(or mnemonic
codes) instead of 0’s and 1’s.These can have maximum up to 5 letter
combination. Eg: ADD for addition, SUB for subtraction. Also called
symbolic programming language.
• Programmes are translated into machine language using Assemblers.
• Used in kernels and hardware driver,games, graphics.
•Advantages-
•It Is easier to understand and use as compared to machine
language.
•It is easy to locate and correct errors.
•It is easily modified.
•Disadvantages-
•Like machine language, it is also machine
dependent/specific.
•Since it is machine dependent , the programmer also
needs to understand the hardware.
rd
3 generation programming language.
• Introduced in 1950’s.
• Purpose is to enable people to write programs easily in their
language.
• Uses compiler.
• In 1954,FORTRAN was invented at IBM by John Backus. It was the first
widely used high level general purpose programming language to
have a functional implementation.
• Advantages-
• Easier to learn and understand than an assembly language
• Error detection easy
• Are machine independent programs therefore programs written in a
this language do not have to be reprogrammed when a new compiler
is installed
• Programmers do not need to learn a new language for each computer
they program.
•Disadvantage
•Less efficient than assembly language and require a
greater amount of computer time for translation into
machine instructions.
Object Model
• An object model is a logical interface, software or system that is
modeled through the use of object-oriented techniques. It enables
the creation of an architectural software or system model prior to
development or programming.
• An object model is part of the object-oriented programming (OOP)
lifecycle.
• An object model helps describe or define a software/system in terms
of objects and classes. It defines the interfaces or interactions
between different models, inheritance, encapsulation and other
object-oriented interfaces and features.
Principles of Object -Oriented system
• The conceptual framework of object–oriented systems is based
upon the object model. There are two categories of elements in
an object-oriented system −
• Major Elements − By major, it is meant that if a model does not
have any one of these elements, it ceases to be object oriented.
The four major elements are −

• Abstraction
• Encapsulation
• Modularity
• Hierarchy
•Minor Elements − By minor, it is meant that these elements
are useful, but not indispensable part of the object model.
The three minor elements are −

•Typing
•Concurrency
•Persistence
Abstraction
• Abstraction is one of the key concepts of object-oriented
programming (OOP) languages. Its main goal is to handle complexity
by hiding unnecessary details from the user. That enables the user to
implement more complex logic on top of the provided abstraction
without understanding or even thinking about all the hidden
complexity.
• That’s a very generic concept that’s not limited to object-oriented
programming. You can find it everywhere in the real world.
• Grady Booch has defined abstraction as follows −
• “An abstraction denotes the essential characteristics of an object that
distinguish it from all other kinds of objects and thus provide crisply
defined conceptual boundaries, relative to the perspective of the
viewer.”
• Example − When a class Student is designed, the attributes
enrolment number, name, course, and address are included while
characteristics like pulse_rate and size_of_shoe are eliminated, since
they are irrelevant in the perspective of the educational institution.
Encapsulation
• Encapsulation is the process of binding both attributes and methods
together within a class. Through encapsulation, the internal details of
a class can be hidden from outside. The class has methods that
provide user interfaces by which the services provided by the class
may be used.
Modularity
•Modularity is the process of decomposing a problem
(program) into a set of modules so as to reduce the overall
complexity of the problem.
•Booch has defined modularity as −
•“Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled
modules”
Hierarchy
• In Grady Booch’s words, “Hierarchy is the ranking or ordering of
abstraction”. Through hierarchy, a system can be made up of
interrelated subsystems, which can have their own subsystems and so
on until the smallest level components are reached. It uses the
principle of “divide and conquer”. Hierarchy allows code reusability.

• The two types of hierarchies in OOA are −


• “IS–A” hierarchy − It defines the hierarchical relationship in
inheritance, whereby from a super-class, a number of subclasses
may be derived which may again have subclasses and so on. For
example, if we derive a class Rose from a class Flower, we can say
that a rose “is–a” flower.
• “PART–OF” hierarchy − It defines the hierarchical relationship in
aggregation by which a class may be composed of other classes.
For example, a flower is composed of sepals, petals, stamens, and
carpel. It can be said that a petal is a “part–of” flower.
Typing
• According to the theories of abstract data type, a type is a
characterization of a set of elements.
• In OOP, a class is visualized as a type having properties distinct from
any other types. Typing is the enforcement of the notion that an
object is an instance of a single class or type.
• It also enforces that objects of different types may not be generally
interchanged; and can be interchanged only in a very restricted
manner if absolutely required to do so.
Concurrency
• Concurrency in operating systems allows performing multiple tasks or
processes simultaneously.
• When a single process exists in a system, it is said that there is a single
thread of control. However, most systems have multiple threads, some
active, some waiting for CPU, some suspended, and some terminated.
• Systems with multiple CPUs inherently permit concurrent threads of
control; but systems running on a single CPU use appropriate algorithms to
give equitable CPU time to the threads so as to enable concurrency.
• In an object-oriented environment, The active objects have independent
threads of control that can execute concurrently with threads of other
objects.
• The active objects synchronize with one another as well as with purely
sequential objects.
Persistence
• An object occupies a memory space and exists for a particular period
of time.
• In traditional programming, the lifespan of an object was typically the
lifespan of the execution of the program that created it.
• In files or databases, the object lifespan is longer than the duration of
the process creating the object. This property by which an object
continues to exist even after its creator ceases to exist is known as
persistence.
Class Syntax
class ClassName
{
Access specifier: // can be private,public or protected
Data members; // variables to be used
Member Functions(){} //Methods to access data members
}; //class name ends with a semicolon

You might also like