Programming Model or Programming Paradigm, Procedural programming, Object oriented programming

Programming model (प्रोग्रामिंग मॉडल)

Programming model defines the designing methodology and implementation of any programming language.With the help of which we can use key features and building blocks of programming language to create programs for solution of specific problem. In other words "Programming model shows that how programming language can analyse and solve any problem by creating programs."
Generally following two types of programming models are used by most programming languages-
प्रोग्रामिंग मॉडल के द्वारा किसी प्रोग्रामिंग लैंग्वेज की डिजाइनिंग मेथोडोलोजी एवं कार्यान्वयन को परिभाषित किया जाता है। जिसकी सहायता से हम प्रोग्रामिंग लैंग्वेज के मुख्य फीचर एवं बिल्डिंग ब्लॉक्स का प्रयोग कर किसी समस्या को हल करने के लिए प्रोग्राम तैयार कर सकते है।दुसरे शब्दों में "प्रोग्रामिंग मॉडल यह दर्शाता है कि किस प्रकार प्रोग्रामिंग लैंग्वेज में, किसी समस्या को हल करने के लिए उसका विश्लेषणकर प्रोग्राम लिखा जाता है।" सामान्यतः अधिकांश प्रोग्रामिंग लैंग्वेज द्वारा निम्न दो में से एक प्रोग्रामिंग मॉडल प्रयुक्त किया जाता है :-
1)  Procedural programming (प्रोसीज़रल प्रोग्रामिंग)
2) Object oriented programming (ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग)

Procedural programming model/language(PPL):-

This type of programming language is based on procedure or structure. It doesn't focus on user data. 
If any software is prepared by PPL then to make any change in its design is very difficult and costly. PPL is a top-down designing approach. It kept user data and associated functions separately due to which If we want to make any change in user data then we must need to find and make change in its all associated functions as well which is a difficult task. In PPL, software maintenance is very expensive and time consuming which increases the project budget up to several times. PPL doesn't support concepts of OOP's.
इस प्रकार की प्रोग्रामिंग लैंग्वेज प्रोसीजर या स्ट्रक्चर पर आधारित होती है। यह यूजर के डाटा पर केन्द्रित नहीं होती है। यदि PPLके द्वारा किसी सॉफ्टवेर का निर्माण किया जाता है तब उसके डिजाईन में परिवर्तन करना बहुत कठिन एवं महंगा होता है। PPL टॉप-डाउन डिजाइनिंग एप्रोच है। यह यूजर डाटा एवं उससे सम्बंधित फंक्शन को पृथक रखती है जिसके कारण यदि हम यूजर डाटा में परिवर्तन करना चाहते है तब हमे उससे सम्बंधित सभी फंक्शन को खोजकर, उनमे भी परिवर्तन करना होगा जो की एक कठिन कार्य है। PPL में सॉफ्टवेर का रखरखाव बहुत महंगा एवं समय खर्च करने वाला होता है जिससे प्रोजेक्ट का बजट कई गुना बढ़ जाता है। PPL, OOP's के सिद्धांतो का समर्थन नहीं करती है।        
Example (उदाहरण):-

#include<iostream.h>
#include<conio.h>
struct student{
int roll_no;
char name[20];
float marks;
}s;
void read_student(student){
cout<<"Enter Roll Number"<<endl;
cin>>s.roll_no;
cout<<"Enter Name"<<endl;
cin>>s.name;
cout<<"Enter Marks"<<endl;
cin>>s.marks;
}
void write_student(student){
cout<<"Roll Number="<<s.roll_no<<endl<<"Name="<<s.name<<endl<<"Marks="<<s.marks<<endl;
}
void main(){
clrscr();
cout<<"Enter Details of Student"<<endl;
read_student(s);
getch();
clrscr();
cout<<"Details of Student is:-"<<endl;
write_student(s);
getch();
}

Note- By default domain/access specifier of a structure or union is public.
नोट- स्ट्रक्चर एवं यूनियन का पूर्व निर्धारित डोमेन/ एक्सेस स्पेसिफायर पब्लिक होता है।   

Object oriented programming model/language(OOPL)- 

This type of programming language is based on user data. It doesn't focus on procedure or structure of programming language. If any software is prepared by OOPL then to make any change in its design is very easy and cost effective. OOPL uses bottom-up design approach. It kept user data and associated functions together due to which we can easily make any change in user data as well as its associated functions. In OOPL, software maintenance is cost effective and less time consuming which doesn't increases the project budget. OOPL supports all the concepts of OOP's. OOPL is able to represent objects and their relationship of real world in programs. Simula is the first object-oriented programming language.
इस प्रकार की प्रोग्रामिंग लैंग्वेज यूजर के डाटा पर आधारित होती है। यह प्रोग्रामिंग लैंग्वेज की प्रोसीजर या स्ट्रक्चर पर केन्द्रित नहीं होती है। यदि OOPL के द्वारा किसी सॉफ्टवेर का निर्माण किया जाता है तब उसके डिजाईन में परिवर्तन करना बहुत ही आसान  एवं सस्ता होता है। OOPL बॉटम-अप डिजाइनिंग एप्रोच है। यह यूजर डाटा एवं उससे सम्बंधित फंक्शन को एक साथ रखती है जिसके कारण हम यूजर डाटा एवं उससे सम्बंधित सभी फंक्शन में आसानी से परिवर्तन कर सकते है। OOPL में सॉफ्टवेर का रखरखाव बहुत सस्ता एवं समय की बचत करने वाला होता है जिससे प्रोजेक्ट का बजट नहीं बढ़ता है। OOPL, OOP's के सभी सिद्धांतो का समर्थन करती है। OOPL, वास्तविक दुनिया के ऑब्जेक्ट एवं उनके संबंधो को प्रोग्राम में व्यक्त करने में सक्षम है। सिमुला, प्रथम ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। 
Example(उदाहरण):-

#include<iostream.h>
#include<conio.h>
class student{
int roll_no;
char name[20];
float marks;
public:
void write_student();
void read_student();
}s;
void student::read_student(){
cout<<"Enter Roll Number"<<endl;
cin>>roll_no;
cout<<"Enter name"<<endl;
cin>>name;
cout<<"Enter marks"<<endl;
cin>>marks;
}
void student::write_student(){
cout<<"Roll Number= "<<roll_no<<endl<<"name= "<<name<<endl<<"marks= "<<marks<<endl;
}
void main(){
clrscr();
cout<<"Enter Details of Student"<<endl;
s.read_student();
getch();
clrscr();
cout<<"Details of Student is:-"<<endl;
s.write_student();
getch();
}

In above program if user added a new data member 'grade' to student class then he/she will need to make change in class member functions only, all other functions and classes are remain unchanged. 
All advanced programming languages like Java, Python,PHP etc supports concept of OOP’s. 
उपरोक्त प्रोग्राम में यदि यूजर द्वारा स्टूडेंट क्लास में एक नया डाटा मेम्बर 'ग्रेड' जोड़ा जाता है तब उसे केवल उस क्लास के मेम्बर फंक्शन में ही परिवर्तन करना होता है अन्य सभी फंक्शन एवं क्लास अपरिवर्तित रहते है। सभी एडवांस प्रोग्रामिंग लैंग्वेज जैसे जावा,पाइथन,पीएचपी इत्यादि OOP's के सिद्धांतो का समर्थन करती है।  

No comments:

Post a Comment