Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.

Similar presentations


Presentation on theme: "Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand."— Presentation transcript:

1 Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand

2 INTRODUCTION  Structured programming was most common way to organize a program.  A programming paradigm defines the methodology of designing and implementing program using the key features and building blocks of a programming language

3  Program: A program in a procedural language is a list of instruction where each statement tells the computer to do something.  PROCEDURAL PROGRAMMING: It is an approach to programming.  Lays more emphasis on procedure than data  Separates the function and data manipulated by them  Whenever the definition of a type changes, the functions referring to this type must also be changed to reflect the change

4 PROCEDURAL PROGRAMMING  The change in the design must also be modified to copy with the change in structure that shows procedural programming is susceptible to design changes that shows procedural programming is susceptible to design changes  As design changes lead to many modification in the code this lead to increased time and cost overheads at times

5  Modular programming (also known as top down design and stepwise refinement):A set of related procedure with the data they manipulate is called a module  It is a software design technique that increases the extent to which software is composed of separate, interchangeable components called modules by breaking down program functions into modules, each of which accomplishes one function and contains everything necessary to accomplish this. Conceptually, modules represent a separation of concerns, and improve maintainability by enforcing logical boundaries between components. Modules are typically incorporated into the program through interfaces. A module interface expresses the elements that are provided and required by the module. The elements defined in the interface are detectable by other modules. The implementation contains the working code that corresponds to the elements declared in the interface. separation of concerns maintainabilityimplementationseparation of concerns maintainabilityimplementation

6 OBJECT BASED PROGRAMMING =>In object based programming data and its associated meaningful function are enclosed in one single entity a class =>Class are allowed to access its interface (how the uses views) but cannot access its implementation details (how the process is actually taking place)

7 Object: Object is an identical entity with some characteristics and behavior.  Object is the basic unit of object- oriented programming. Objects are identified by its unique name. An object represents a particular instance of a class. There can be more than one instance of a class. Each instance of a class can hold its own relevant data  Example : ram, mohan etc

8 => Classes: A class is blue-print representing a group of object that share some common properties. => Classes are data types based on which objects are created. Objects with similar properties and methods are grouped together to form a Class. Thus a Class represents a set of individual objects. Characteristics of an object are represented in a class as Properties. The actions that can be performed by objects become functions of the class and are referred to as Methods

9 BASIC CONCEPT OF OOPS  DATA ABSTRACTION  ENCAPSULATION  MODULARITY  INHERITANCE  POLYMORPHISM

10 DATA ABSTRACTION: It is an act of representing essential features without including the background details.  Data Abstraction increases the power of programming language by creating user defined data types. Data Abstraction also represents the needed information in the program without presenting the details

11 Data Encapsulation: The wrapping up of data and function into a single unit(called class) is called encapsulation.. Data Encapsulation combines data and functions into a single unit called Class. When using Data Encapsulation, data is not accessed directly; it is only accessible through the functions present inside the class. Data Encapsulation enables the important concept of data hiding possible.

12 MODULARITY  MODULARITY is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules.  It reduces complexity of program to some degree.  It creates documented boundaries of a program.

13 INHERITANCE: It is capability of one class of thing to inherit capability from another class REUSABILITY: This is term refers to the ability for multiple programmers to use the same written and debugged existing class of data. This is a time saving device and adds code efficiency to the language. Additionally, the programmer can incorporate new features to the existing class, further developing the application and allowing users to achieve increased performance. This time saving feature optimizes code, helps in gaining secured applications and facilitates easier maintenance on the application.

14 => Polymorphism: It is ability for a message to process in more than one form. => Polymorphism allows routines to use variables of different types at different times. An operator or function can be given different meanings or functions. Polymorphism refers to a single function or multi-functioning operator performing in different ways.

15 ADVANTAGES OF OOPS => simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear; =>modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system; =>modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods;

16  extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones;  maintainability: objects can be maintained separately, making locating and fixing problems easier;  re-usability: objects can be reused in different programs without writing the code of a program.

17 DISADVANTAGES OF OOPS DISADVANTAGES OF OOPS  With OOP class tend be overly generalized.  The relation among classes become artificial at times.  The OOP program design is tricky.  Also one needs to do proper planning and proper OOP programming.

18  The Evolution of Programming Languages  There are two type of Programming Languages  1. Low Level Languages: It is machine oriented and required extensive knowledge of computer circuitry. machine language, in which instruction are written in binary code(Using 1 and 0), is the only language the computer can execute directly.  2. Assembly Language: an instruction are written using symbolic names for machine operations(i.e., READ,ADD etc)

19  A programming language should serve two related purposes:  1. It should provide a vehicle for the programmer to specify action to be executed.  2. It should provide a set of concepts for the programmer to use when thinking about what can be do.

20 Programming Language generations

21 First-Generation Languages  Machine language:  Consists of binary numbers ( 0 s and 1 s)  Is the earliest programming language  Is the only language the computer understands without translation  It is machine dependent; each family of processors has its own machine language

22 Second-Generation Languages  Assembly language:  Resembles machine language  Is a low-level language  Uses brief abbreviations for program instructions.  Abbreviations are called mnemonics  A program is written in source code (text file) and translated into machine language by an assembler

23 Third-Generation Languages  Procedural languages: =>Are high-level languages that tell the computer what to do and how to do it. =>Create programs at a high level of abstraction. =>Are easier to read, write, and maintain than machine and assembly languages =>Use a compiler or interpreter to translate code. =>Fortran and COBOL are third-generation languages

24 Compilers and Interpreters  An interpreter translates source code one line at a time and executes the instruction  A compiler is a program that changes source code to object code, all in one shot  Example of an interpreted language: BASIC; a compiled language: C

25 Fourth-Generation Languages  Fourth-generation languages are non-procedural, high-level specification languages  They do not force programmers to follow procedures to produce results (they’re very close to English, sometimes)  Types of fourth-generation languages include:  Report generators  Languages for printing database reports (generate a program to generate the report)  Query languages  Languages for getting information out of databases (generate a program to process a query or generate a form)

26  Also include visually-oriented languages  More ambitious 4GL environments attempt to automatically generate whole systems from the outputs of CASE tools, specifications of screens and reports, and possibly also the specification of some additional processing logic, including data flow diagrams, entity relationship diagrams, entity life history diagrams  Fifth-generation languages: It is design ed to make the computer solve the problem for you. These include artificial intelligence and neural networks oriented languages

27  Class relationship and inheritance:  1. is –a relationship: When a class (say B) inherits from another class(say A) it becomes a “kind –of “ its base class. That is class ‘B’ IS –A kind of class ‘A’.  2. HAS-A Relationship: When a class owns an object of another class then it is class HAS- A relationship. END END


Download ppt "Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand."

Similar presentations


Ads by Google