All About Object Oriented Programming

Object Oriented Programming
 
1. DefinitionObject-oriented programming is a programming paradigm which is oriented to the object. All data and functions within this paradigm wrapped in classes or objects . Compare with structured programming logic. Each object can receive messages, processing data, and sending messages to other objects .
Object -oriented data model is said to be able to give more flexibility, ease of changing the program, and is widely used in large -scale software engineering. Furthermore, supporters claim that OOP. OOP is easier to learn for novice compared with previous approaches, and approaches OOP easier to develop and maintain.
OOP spin on the concept of the object which is the basic element of your program. When we compare with the real world, we can find several objects around us such as cars, lion, man, and so on . These objects are characterized by attributes and behaviors.
For example, the object has the attributes of a car transmission type, color and manufacturing. May behave turning, braking and acceleration. In the same way we can also define the differences in the nature and behavior of lions.
2. Basic ConceptsObject-Oriented Programming (OOP) is a programming paradigm which is oriented to the object. All data and functions within this paradigm wrapped in classes or object.
Programming language that is commonly used in the PBO is C + + ( Borland Exodus called Borland C + +, while from Microsoft called Ms C + +. Yet the latter is less popular ). Similarly, if there is a programming language that uses C + + as the primary basis for its development , the language can be used for PBO, such as Java, which is a major concern in this training ( language is very popular in computer network, in this case is : the Internet ).
3. Characteristics1 . AbstractionIs the way we look at a system in a simpler form, ie as a collection of subsystems ( objcet ) which interact with each other . Tool - clicking is something abstract class objcet is modularity. Objects can be written and maintained separate ( independent ) from other objects.

        
Abstraction is the ability of a program to pass aspects of information processed by it, namely the ability to focus on the core . Each object in the system serves as a model of the "actors" who can do abstract work, and report changes in circumstances, and communicate with other objects in the system, without revealing how this excess is applied.
2 . EncapsulationEncapsulated is a mechanism or method to hide or avoid a potential interference with the process of simultaneously simplifying the use of the system itself that can not be accessed directly by means of a method or process is not defined but defined entirely as public as private.
For example, the data type integer composed of some sort, ie char, short, long and _int64 each occupy space in the memory of different magnitude but similar in operations that can be applied, namely the addition, subtraction, multiplication, and division.
3 . InheritanceInheritance is a process whereby a derived class from other classes so that he gets the characteristics or nature of the class. Or it could be said to form a hierarchy.Example : class hierarchyJava Keyword : extends
   
4 . PolymorphismPolymorphism is derived from the Greek word meaning "Many forms". In OOP , this concept allows the use of a common interface to govern an object that perform an action or actions that might give a similar end result, but through a different process . In a more general concept of polymorphism is often referred to as "one interface, lots of action".
For example : there are five classes, where one class is defined public primary and four other classes that are connected in a hierarchy is defined as normal. There is a class such as Cats, Horses and Chickens are all derived from the Animal class, each class has the same method name is spoken but the details vary for each class.
In other words that Polymorphism is an object can have multiple methods of the same name but different implementation
Implementation of the concept of polymorphism :a. Overloading : The ability to use the same name for several different method parameters (type and or number).b . Overriding : The ability of a subclass to override a superclass method, that is by using the same name and parameters to the method.
4. General Terms In OOP1 . Attributea. Definition and Overview of AttributesAttributes of a class is a global variable that is owned by a class, attribute access rights of private, public or protected.
An attribute that is declared as private can only be accessed directly by the class wrap, while other classes can not access this attribute directly.
An attribute that is declared as public can be accessed directly by other classes outside of class wrap.
An attribute that is declared as protected can not be accessed directly by other classes outside of class wrap, except that access class is a subclass of class wrap.
         
Attributes are also commonly referred to state / properties / fields is part owned by a class that does not do the surgery, but her surgery so as to change the value of the attribute.
b . Characteristics AttributesIn class, referred to as variable attributes. Attributes can distinguish between one another object with object. For example, in the class : the students, the students are object A, and the student object B.
          
The only difference between object the A and the B is its NPM (Student Identification Number) which is an attribute of the object. On attributes  there are also two variable terms, ie Instance Variables and Class Variables .
Where each variable has its own characteristics, including : Instance Variables In object à each instance has its own variables and store values.

          
While in Class Variables à attribute shared by all object originating from the same class, as well as all object have the same value of the class variable. object attributes possessed of the same class.
2 . Methodsa. Definition and Overview of MethodMethod is a function or procedure that is created by a programmer in a Class. In other words, the method in a class similar to the function or procedure in procedural programming.

          
In a method in a class also has access permissions as well as attributes of the class, access permissions that include private, public and protected which has the same meaning in the access permission attributes discussed earlier . A class may have more than one method with the same name as long as it has a different input parameters so that the compiler or interpreter can recognize which method is invoked.

          
This is called overloading. In a classroom, there are also the so-called static methods or attributes that have the keyword static . The purpose of the static here is a method that can be accessed to share with all other objects without having to create an object that has a static method was (without the new process), but a static method has limitations that can only access the attribute or other method in the class that wrap which is also static . Static method is usually implemented for the main method.
b . characteristic MethodIn a class, stored in the form of method behavior. Method is a series of statements / commands ( command = line program ) in a class that handle specific tasks. Methods are things that can be done by an object of a class.
Method defined in class but invoked through the object. Method has a role include :i . Changing the value of an attribute of an object,ii . Receive information from other objects, andiii . Sending information to another object to perform a task ( how objects communicate with other objects is to use the method).
3. ClassIs a model that contains a set of attributes and methods in a unit for a particular purpose. For example, humans have a class attribute weight, height, age and then have a method to eat, drink, sleep. Method in a class can change the attribute which is owned by the class. A class is the basis of modularity and structure in an object -oriented programming.
a. Definition and Overview of ClassClass is defined as a blueprint (plan), or prototype, that defines the variables and methods common to all objects of a certain type n (n means a certain amount). A class is a structure that resembles a data type itself, eg point data type that consists of x and y coordinates. Java language has been using a class to declare the type of data point for the Java programming language is a pure object -oriented programming language that is not familiar with the structure, but to know what is called a class.

          
Differences with a structure of a class is a class can stand alone and can be used for various purposes other classes, whereas a structure can not stand alone. A more flexible class to be used by another class without having to disassemble the code of the main program, whereas if it is used then the structure must be demolished transform program code copied parts of the structure to the other main program code.

          
A file may consist of a variety of classes, but usually in the Java programming language file consists of only one class that is stored with the class name, eg file list . Java contains a class list. However, if the class is created, for example name_class public class, then the class should be stored in a single file just for one class. Once the compilation is done then there will be a Java file. Byte code of the class that contains every class.

          
If a file is composed of two classes, then after the compilation will produce the two files. Classes that will be read by the Java interpreter when the program is executed. A class when the program is executed and the new command is executed, it will be made an object.
Class is a template for object creation. Class also has members, including : attributes and methods .
Understanding of brevity :i . Class is a pattern / template that describes a collection of objects that have the same properties and behavior.ii . Class is the data structure of the object (the blueprint of an object), and the process of making an object of a class is also called instantiation.iii . Class is a data definition and function of a thing (object, concept, etc.).iv . Variables declared in the class and method objects owned by
b . Class characteristicsClass has several characteristics, including : members of the class consists of attributes and methods. Each class member has the access control itself, the point is whether the class members can be accessed freely ( with a public type ) or can only be accessed through an interface.
In this case, the interface is a device that is used for communication between different objects that do not have any relationship . Interface can be regarded as a communication protocol between these objects.

4 . The ObjectIs a manifestation of the class, each object will have attributes and methods which are owned by his class, for example : Amir, Ahmad, minister to an object of class humans . Each object can interact with other objects in spite of coming from a different class.
a. Object Definitions and OverviewObject is something that has identity (name), generally also have data about himself or another object and have the ability to do something and be able to work together with other objects. Basically all the objects in the world can be regarded as an object. Houses, cars, motorcycles, desks, and computers are examples of objects that exist in the real world. Object is the implementation of the class. In simple, can be said to consist of properties ( attributes ) and methods.
Understanding of brevity :i . Object is a special object that is used to access members of the object ( attribute or method) of the object itself.
ii . If there are other variables that have the same name as the name attribute in the object , "this" can be used to refer to the object's attributes.
b . Object characteristicsEach object has two main characteristics, namely attributes and behavior. Is the status object attributes and behavior is the behavior of the object.

          
A simple example is a bicycle. Object has attributes bike : pedals, wheels, and gears, speed and has a behavior like pacing and brakes. Just like the depiction in the real world, the development of the concept of OOP program also uses an object model that will store the variable attributes and behavior in a method or function. .

Comments

Popular Posts