Wednesday, December 30, 2009

Object-oriented programming

Object-oriented programming (English: object-oriented programming OOP is abbreviated) is a programming paradigm to the object-oriented. All data and functions within this paradigm is wrapped into classes or objects. Compare with structured programming logic. Each object can receive messages, process data, and send messages to other objects.

Object-oriented data model is said to give more flexibility, ease of changing the program, and is widely used in engineering large-scale software. Furthermore, supporters claim that OOP OOP is easier to learn for beginners than with previous approaches, and object-oriented approach more easily developed and maintained.

The basic concept of Object Oriented Programming

Object-oriented programming emphasizes the following concepts:
  1. class is a collection of definitions of data and functions in a unit for a particular purpose. For example 'class of dogs' is a unit consisting of data definitions and functions which refer to various kinds of behavior / derived from dogs. A class is the basis of modularity and structure in object-oriented programming. A class should typically be recognizable by a non-programmer domain name even associated with existing problems, and code contained in a class should be (relatively) autonomous and independent nature (as the code is used if not using OOP). With modularity, the structure of a program would be associated with aspects of the problem to be resolved through the program. This way will simplify the mapping of the problem to a program or vice versa.
  2. Object is to wrap the data and functions together into a unit in a computer program; object is the basis of modularity and structure in an object-oriented computer program.
  3. Abstraction is the ability of a program to pass information processing aspects of it, namely the ability to focus on the core. Every object in the system serve as a model of the "actors" who can do abstract work, reports and changes in circumstances, and communicate with other objects in the system, without disclosing how the excess is applied. Processes, functions or methods can also be made abstract, and several techniques used to develop a the abstract.
  4. Encapsulation is an object Ensure user can not change the state of an object in a way that is not feasible; only method in which the object is given permission to access the situation. Each object access interface that mentions how other objects can interact with it. Other objects will not know and depend on the representation of the object.
  5. Polymorphism through message sending. Does not depend on subroutine calls, object-oriented language can send messages; specific methods associated with the delivery of the message depends on the particular object plane in which it was sent. For example, if a bird get the message "move fast", he'll move his wings and fly. When a lion receive the same message, he will move his feet and ran. Both answered a similar message, but in accordance with the animal's ability. This is called polymorphism as a variable in the program single can hold a variety of different types of objects while running the program, and the same text that the program can call a few different methods at different times in the same calling. This is in contrast to functional languages achieve polymorphism through the use of
First-class functions.
  1. Set Inheritas polymorphism and encapsulation by allowing objects to be defined and created a special type of object already exists - these objects can share (and expand) their behavior without re-touching to implement such behavior (object-based languages do not always have inheritas.)
  2. Using OOP do so in solving a problem we do not see how to solve a problem (structured) objects but what can be done solving the problem. For example, assume we have a department that has a manager, secretary, clerk and other data. Suppose the manager wants to obtain data from the administration bag is not the manager have to take it directly but can be ordered administration officials to retrieve bags. In the case of a manager does not have to know how to retrieve the data but the manager can get the data via object adminiistrasi officer. So to solve a problem with collaboration among the objects that exist because every object has his own job description.
How do I recognize the visual programming?

In essence, object-oriented visual programming brings to the next level. Visual programming goal is to make programming easier for the programmer and more easily accessible by the borrowing language nonprogrammer with OOP, and
use practices graphically or visually. Users visual programming allows for more focus on solving problems than how to handle the programming language. Here you do not need to learn the syntax, or writing code.

Visual programming is a method of programming where the programmer to make connections between objects by drawing, pointing, and clicking on the icons and diagrams and by interacting with the flow chart. Thus, programmers can create programs by clicking on the icon that represents programming routines in general.

  1. Examples of visual programming is Visual BASIC, object-oriented programming language based on Windows from Microsoft that allows users to develop Windows and Office applications to create command buttons, text boxes, windows and toolbars.
  2. The next will be a link to a small BASIC program to perform certain actions. Visual BASIC is an event-driven, meaning the program waiting for user to do something ( "event"), such as click on the icon, and then the program will respond. For example, at the beginning of the user can use drag and drop tool (drag-and-drop) to develop a graphical user interface that made automatically by the program. Karen its use easy, Visual BASIC allows novice programmers to creates based applications windows of interest.
The next will be a link to a small BASIC program to perform certain actions. Visual BASIC is an event-driven, meaning the program waiting for user to do something ( "event"), such as click on the icon, and then the program will respond. For example, at the beginning of the user can use drag and drop tool (drag-and-drop) to develop a graphical user interface that made automatically by the program. Karen its use easy, Visual BASIC allows novice programmers to creates based applications windows of interest.

Pemrograman Berorientasi Objek

What is Object?

Imagine you are programming in traditional languages such as BASIC third generation, create a line coded instructions at a time. When you are working on some segments of the program (eg, counting overtime), you would think, "I'll bet other programmers to make program's. Sure would save a lot of time ". Fortunately, there are repeated cycles, the object-oriented programming, an improved version of the 3GL.

Working OOP: Objects, Messages, and object-oriented programming method consists of the following components:

  1. What is OOP: object-oriented programming (OOP, pronounced "oop"), data and instructions for processing where the data are combined into "objects" that can suffice used on other programs. The most important thing here is the object.
  2. What is "object": the object is self-contained module of code that have been prepared pemrogaman earlier. Made load modules or both (1) branch of data, and (2) processing instructions that can be done on the data.
  3. When was the object data will be processed - send a "message": the object becomes part of a program, specific instructions are activated only when the "message" associated've sent. Is sending a warning message to the object when the operation should be performed involving a particular object.
  4. How data is processed object - "method": message simply identifies operations. How true it is done will be included in processing instructions that are part of the object. Instruction processing method is called.
Block reuse program code after you write a block of source code, the code can be reused in other programs. So, with OOP, unlike traditional programming-you do not need to start from scratch. Compared with traditional pemrogaman, learn the object pemrogaman berorintasi takes longer because of such thinking in new ways. Nevertheless, the benefits of OOP objects memilliki can be used repeatedly in different applications and by different programmers, because it was time pengembanganya any faster and could cost berkurang.Tiga OOP Concepts

How do I define the three basic concepts of OOP?

Object-oriented programming has three basic concepts are important, namely enskaplusi, inheritance, and polymorphism. Actually, the concept is not scary like seme. Encapsulation means that the object contains (1) data and (2) processing the relevant instructions. After the object is created, objects can be reused for other programs. The use of an object can be described through the concept of class and inheritance.

Inheritance (inheritance) after creates an object. You can use it as a foundation for the same object which has the same behavior or characteristics. All the objects come from or interconnected to form a class.

Each class contains special instructions (method) that can. class group uniqe to arranged in a hierarchy-class or subclass. Inheritance is a method to pass from one object cirri from class to subclass in the hierarchy. So the new object can be created with the passing of traits from existing classes.

Example as follows: "Object MACINTOSH could be one example PERSONAL COMPUTER classes, which inherit properties from classes COMPUTER SYSTEM". If you want to add a new computer, such as COMPAQ, you just enter what makes it different computers with other computers. Characteristics of personal computers can be inherited.

Polymorphism polymorphisms means "many forms". In object-oriented programming, polymorphism means that a message (a request which was generalized) give different results based on the object that was sent. Polymorphism is very useful. With polymorphism programmer can create a procedure of object type previously unknown, but it will be known when the program is run on a computer. Freedman gave the following example: "on-screen cursor will change shape from an arrow into a line depending on the program mode". Processing instruction "move the cursor on the screen in response to mouse movements will be written as a" cursor ", and needed to make the cursor polymorphisms into any shape at the time the program starts". Polymorphism also enables a new form of the cursor can be easily diitegrasikan into the program

No comments:

Post a Comment