Presentation is loading. Please wait.

Presentation is loading. Please wait.

Types of Programming Languages

Similar presentations


Presentation on theme: "Types of Programming Languages"— Presentation transcript:

1 Types of Programming Languages
Functional programming language – achieves main effect by the application of function calls Procedure oriented programming languages – focus on subprograms and subprogram libraries Logic programming language (declarative/rule-based programming language) – program expressed in a form of symbolic logic Imperative programming languages – assignment statement is the main feature Sections 12.1, 12.2, 12.3, 12.5, 12.6

2 Object oriented programming language
Three features Provides a mechanism for building an ADT (like the data oriented programming languages) Inheritance Polymorphism Sections 12.1, 12.2, 12.3, 12.5, 12.6

3 Some languages (dialects) that support object-oriented programming
COBOL LISP Perl Ada 95 CLOS C++ (C++ is a derivative of C) Note: these languages were not originally OO, but OO features were added Sections 12.1, 12.2, 12.3, 12.5, 12.6

4 Object-oriented programming languages
Java Smalltalk Eiffel Ruby Java and C++ are not pure object oriented languages Sections 12.1, 12.2, 12.3, 12.5, 12.6

5 Object Oriented Concepts
Class – definition of the ADT Object – instance of the ADT Derived class (subclass, child) – class defined through inheritance Base class (superclass, parent) – class from which the new class is derived Method – subprogram that defines an operation on the class objects Message – calls to the method Sections 12.1, 12.2, 12.3, 12.5, 12.6

6 Object Oriented Concepts
Message protocol (Message interface) – entire collection of methods of an object Overridden method – method in a parent class is overridden by a method in a derived class they have the same signature Signature – name, number and types of parameters (also called protocol) Overloading – methods have same name but different signatures Sections 12.1, 12.2, 12.3, 12.5, 12.6

7 Object Oriented Concepts
Instance variables – unique to a class object Class variables – belong to the class so there is only one copy for the class Instance methods – can operate on instance variables Class methods – usually operate only on class variables and can be called without an object Sections 12.1, 12.2, 12.3, 12.5, 12.6

8 Object Oriented Concepts
Single inheritance – class inherits from a single parent class Multiple inheritance – class has more than one parent class Abstract method (pure virtual method in C++) – method that has no body; descendant classes provide an implementation Abstract class (abstract base class in C++) – class that has at least one abstract method and thus can not be instantiated Sections 12.1, 12.2, 12.3, 12.5, 12.6

9 Inheritance New abstract data type inherits the data and functionality of an existing type New functionality can be added Inherited functionality can be modified Benefit: enables code reuse Sections 12.1, 12.2, 12.3, 12.5, 12.6

10 Polymorphism Polymorphism = polymorphic variables + overridden methods + dynamic binding Polymorphic variables – variable that can reference a base class object or any derived class object Dynamic binding – binding occurs during program execution (dynamic = runtime) Dynamic binding via polymorphic variable – variable asks “what kind of object do I reference?” and calls the appropriate method Sections 12.1, 12.2


Download ppt "Types of Programming Languages"

Similar presentations


Ads by Google