Tuesday 20 March 2018

Advantages and Disadvantages of the Object Oriented Programming

Advantages of Object Oriented Programming 

  • Object oriented programming has several advantage to the programmer and user.
  •  Through inheritance redundant code is eliminated and existing class can be extended according to requirement.
  •  Data hiding can be achieved with the help of the data abstraction and encapsulation Data hiding helps the programmers to build secure programs.
  •  It is easy to partition the work in a project based on a objects.
  •  Object oriented system can be easily upgraded from small to large system.
  •  It provides message passing technique for communication between objects.
  •  It is helpful in reducing complexity of the programs.
  •  Object Oriented Programming supports re-usability of the code.
  •  Security is the first main advantage of OOP, the data and functions are combined together in the form of class.

Disadvantage of the Object Oriented Programming

  •  The message based communication between many objects in a complex system is difficult to implement.
  •  Large program size : Object Oriented program typically involve more lines of code than procedural program It require more memory to process at a great speed. So it runs slower than the traditional programming language.
  •  It works on object and everything of the real world is not possible to divide into new neat classes and sub-classes.
  •  There are problems that lend themselves well to functional programming style, logic programming style, or procedure based programming style and applying object oriented programming in those situation will not result in efficient programs.

Monday 19 March 2018

Basic Concept in Object Oriented Programming

All object oriented programming languages provide mechanism that help you implement the object oriented model. It is therefore necessary to understand some of the concept extensively in object oriented programming.

Classes :-
 The entire set of data and code of an object can be made using a user defined data type called as class.
 It is one of the types of abstract data types.In sort, we can call the class is data type of object. Classes are user defined data types and they behave like the built in type of different programming languages.
 Once class has defined , we can create any number of objects of that.
 Class is the collection of similar type of objects.

Object :-
 Object is called as the instance of the class.It is the run time entity in an object oriented system.In short, we can call object as a variable of type class.
 After creation, objects take up space in computer memory and have associated address like 'record' in pascal and 'structure' in C.
 When the program is executed, object can establish the path of communication among them by passing messages in between.
 Each object is associated with data of type class with which they are created.A class is thus collection of objects of similar types.
 For example, Maharashtra , Gujarat , Bengal , Goa , Tamilnadu , are the member of class India.
 In object oriented programming language, objects are represented with data and methods(function) as shown in following figure.
                         Fig. a) Representation of an object


                    Fig. b) Example of representation of an object

See the above example, the class 'Batsman' has been declared.It contains data members Name and Innings as well as methods average ( ) and strike_rate ( ).
 In order to create the object of type Batsman we have to use following notation.

Procedure and Object Oriented Programming Language

Procedure Oriented Programming Language:-

High level language such as COBOL , FORTRAN AND C is commonly known as procedure oriented programming.
In the procedure oriented approach, the problem is viewed as a sequence of things to be done such as reading , calculating and printing.
Procedure oriented programming basically consist of writing list of instruction for the computer to follow and organizing these instructions into groups known as functions.
Procedure oriented programming language are not helpful in solving these problems having large complexity.
Another serious drawback with the approach is that it does not work on real world problems very well.
In procedure programming language top down programming approach is used in program design.

Object Oriented Programming Language:-

Many drawbacks of procedure language are eliminated by object oriented language.
Object oriented language combine data and functions that operate on data into a single unit called as object. This helps to achieve data encapsulation and data hiding.
OOP allows decomposition of a problem into number of entities called as objects and then build data functions around these objects.
The data of an object can be accessed only by the functions associated with that objects.
OOP treats data as a critical element in the program development and does not allow it to flow freely around the system.
Object oriented program can be easily modified whenever necessary.

Difference Between Procedure and Object oriented Programming Language:-


Representation of Algorithm

There were various ways to represent an algorithm:-
   1. As a program
   2. As flowchart
   3. As pseud codes

Program
    A program is set of instruction that are arranged in a sequence that helps computer to solve complex problem.Moreover, the process of writing a program is called Programming.

Flowchart
  A flowchart is nothing but a graphical representation of an algorithm. 
    Flowchart is a representation, primarily through the use of symbols, of the sequence of activities in a system ( process , operation , function or activity ).
  Flowchart uses various graphical symbols. All symbols are connected among themselves to indicate the flow of information and processing.

Flowchart Symbols
  Flowchart symbols are used to represent an algorithm : 

  Terminal:-
       The oval represents any terminal point in a program and generally contains words such as START , END.

Input or Output:-
      The parallelogram represents the input (via keyboard) or Output ( to screen) function.

Process:-
   The rectangle represents the processing operations. For example a = x + y.

Algorithm

An algorithm ( pronounced AL-go-rith-um) is a procedure or formula for solving a problem.A computer can be viewed as an elaborate algorithm.In mathematics and computer science, an algorithm usually means a small procedure that solves a recurrent problem.
    A formula or set of steps for solving a particular problem. To be an algorithm, a set of rules must be unambiguous and have a clear stopping point.Algorithm can be expressed in any language from natural languages like English or French programming language like FORTRAN.
   We use algorithm every day.For example, a recipe for baking a cake in an algorithm.

Advantage of Generalized Algorithm
  It is a foundational element of logic and human reasoning. Generalization points the existence of a domain or set of element, as well as one more common characteristics shared by those elements.
    In the case of certain enumerably infinite sets, we can give explicit instructions for determining the n th member of the set, for arbitrary finite n.Such instruction are to be given quite explicitly, in a form in which they could be followed by a computing machine.

Avoiding Infinite Loops in Algorithm-by Counting
   A loop is a sequence of statement which is specified once but which may be carried out several times in succession.The code "inside" the loop is executed a specified number of times, or once for each of a collections of items, or until some condition is met.
           An infinite loop is a sequence of instructions in a computer program which loops endlessly, either due to the loop having no terminating condition, having one that can never by met or once that causes the loop to start over.
         To be an algorithm, set of rules must be unambiguous and have a clear stopping point.
  A loop counter value can be used to tell how many times a statement or block of statement is to be execute.

Avoiding Infinite Loops in Algorithm-by using a Sentinel Value
   The following sentinel value are used:-
     The break Statement in Loops :
         A break statement can be used to end a loop immediately.
         A break statement ends only the innermost loop or switch statement that contains the break statement.break statement make loops more difficult to understand.
  The continue statement in Loops:
      A continue statement 
               It ends current loop iteration and Begins the next one.

Fundamental of Object Oriented Programming

  • Our computer programs consists of two element i.e code and data. A program is conceptually organized around the data.
  • According to the way of flow of the data, there are two types of programming paradigms.The first way is called procedure oriented programming.In which everything is organized in functions by functions.
  • Flow of execution of the program is taken through the liner steps.The emphasis is given on the procedures rather than data.The data can be accessed anywhere in the functions.So there is no security for this data.
  • C is the best example of such procedure oriented programming. C language employed this programming approach successfully.
  •  
                                    Fig: Procedure Oriented Methodology

The second way is called object oriented programming.Basically,it is introduced to eliminate the flaws in the procedure oriented programming.
 
It is the best way to manage the increasing complexity in procedure orientation.Object Oriented programming organizes the program around the object i.e it treats the data as a critical element in the program development and does not allow it to flow freely around the system.
 
It ties this data more closely to the functions that operate on it and protects it from unintentional by other functions.
An object oriented programming can be characterized as 'data controlling access to code'. It has been given several organizational benefits.
                               Fig: object oriented Methodology

As shown in the above figure the data is centered element in the object, which can be only be accessed by all the functions defined in it. ( In java's terminology, function is called as method).

Object Oriented Programming is having following main features.

   Reduction in the complexity
      Program are divided into objects, which reduces the complexity of the program.

   Importance of data
      Emphasis is given on the data rather than procedure.

   Creation of new data structure
      Method that operate on the data of an object are tied together in a single data structure.

   Data Hiding
      The data used in different object is hidden from outside world.They can not be accessed outside functions.

   Characterization of the objects
      Data structures are designed such a way that they characterize the objects.

   Communication among objects
      Objects in a single program can communicate with each other through methods.

   Extensibility
      New data and methods can be easily added whenever necessary. So, usability of the program is extended.

Introduction and Needs of C++

Introduction:-
 
  • During 1970's and early 1980's had become a dominant programming language for programming. 'C' become very useful and successful programming tool.
  • 'C' was useful in solving complex structural programs.But when a program reaches to a certain size, 'C' was not a flexible to solve such a complexity.
  • To deal with such a complex programs,'Object Oriented Programming; concept was invented.
  • This method of programming reduces the complexity by introducing features like inheritance , encapsulation  abstraction , message passing and polymorphism.
  • Object Oriented Programming helpful in representing real life entities.It allows us to decompose a problem into number of entities called as objects.
  • 'C++ was the first object oriented programming language.It was invented by "Bjarne Stroustrup"

Its Need and Requirements:-

  •  Software engineers continuously looking for a new approach to software design and development which reduces complexity.
  •   Software evolution has a distinct phases or layers of growth.These layers build up one by one over last five decades.Each layer representing an improvement over the previous one.

Monday 19 February 2018

Introduction of PhP

Understanding Through the Definition

PHP is a server-site scripting language designed for web development but also used as a general- purpose programming language.
The PHP hyper text preprocessor (PHP) is a programming language that allows web developers to create dynamic context that interacts with database.PHP is basically used for developing web based software application.

Where PHP can be use

PHP code may be embedded into HTML code , or it can be used in combination with various web template systems , web content management system and web frame work.
We can make E-commerce , content management system , object oriented programmers which can run on the web.
Best live example of PHP is "Facebook". yes Facebook is developed in PHP , so now you can imagine what php can do.

What is Required ?

1) One Laptop / Computer
2) Text editor (i.e Brackets , Notepad++ , Dreamweaver etc)
3) Wamp or Xamp Server
4) Web browser ( Firefox , Chrome etc)

Why should I use PHP?


It is free to download and use.
Most famous CMS are PhP based,

For Example:-
  • WordPress
  • Joomla
  • Drupal
PhP is used on more than 24 millions websites.
Top websites using PhP
  • Facebook
  • Yahoo.com
  • Wikipedia.org
  • FLICKR.com
What should you already Know
  • HTML
  • CSS
  • JQuery (Optional)

How to run PhP Program?

  • First we are download a “wamp server” from google,then install a server.
  • The sign of wamp server is show on toolbar. It is show a green color.
  • Click a wamp server, then start a Myadmin button.
  • Write a Php Program in wamp server

    Simple Starting Code in PhP

    Example:-

    <?php
    echo “<h1>Hello, PHP!</h1>”;
    ?>

    Here, “echo” function is use for print the value on output screen.

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (117) C (77) C# (12) C++ (82) Course (62) Coursera (180) Cybersecurity (22) data management (11) Data Science (95) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flutter (1) FPL (17) Google (19) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (44) Meta (18) MICHIGAN (5) microsoft (4) Pandas (3) PHP (20) Projects (29) Python (753) Python Coding Challenge (228) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses