oo ps and pops

Download Oo ps and pops

If you can't read please download the document

Upload: radha-krishnan

Post on 31-Jul-2015

84 views

Category:

Education


2 download

TRANSCRIPT

Difference between POPs and OOPs:

[!] Procedure Oriented Programming (POP):

1. Main program is divided into small parts depending on the functions.2. The Different part of the program connects with each other by parameterpassing & using operating system. 3. Every function contains different data.4. Functions get more importance than data in program.5. Most of the functions use global data.6. Same data may be transfer from one function to another7. There is no perfect way for data hiding.8. Functions communicate with other functions maintaining as usual rules.9. More data or functions can not be added with program if necessary. For thispurpose full program need to be change.10. To add new data in program user should be ensure that function allows it.11. Top down process is followed for program design.12. Example: Pascal, Fortran.

[!] Object Oriented Programming (OOP) :

1. Main program is divided into small object depending on the problem. 2. Functions of object linked with object using message passing.3. Data & functions of each individual object act like a single unit.4. Data gets more importance than functions in program.5. Each object controls its own data.6. Data does not possible transfer from one object to another.7. Data hiding possible in OOP which prevent illegal access of function from outside of it. This is one of the best advantages of OOP also.8. One object link with other using the message passing.9. More data or functions can be added with program if necessary. For thispurpose full program need not to be change.10.Message passing ensure the permission of accessing member of an objectfrom other object.11.Bottom up process is followed for program design.Example: C++, Java.

Class:Class is a way for describing some properties and functionalities or behaviorsof a group of objects. In other words, the class is considered to be a templatefor some objects.A C# Class is considered to be the primary building block of the language. WhatI mean by the primary building block is that every time you work with C# you willcreate classes to form a program.We can create a class Person that contains:

The properties of any normal person on the earth like:hair color, age, height, weight, eye color. The functionalities or behaviors of any normal person on the earth like:drink water, eat, go to the work.

Object:(Creating an object of a specific class type is called "an instance of the class")

It's an object of some classification (or class, or type) and when you create the object you can specify the properties of that object. What I mean here is: I, as an object, can have different properties (hair color, age, height, weight) than you as another object. For example, I have brown eyes and you have green eyes. When I create 2 objects I will specify a brown color for my object's eye color property and I will specify a green color for your object's eye color property.