You are on page 1of 7

Object-oriented programming (OOP) is a programming paradigm that uses "objects" data structures consisting of datafields and methods and

nd their interactions to design applications and computer programs. Programming techniques may include features such as information hiding, data abstraction, encapsulation, modularity, polymorphism, and inheritance. It was not commonly used in mainstream software application development until the early 1990s. Many modern programming languages now support OOP. Oops! is an HTTP-1.1/FTP proxy server. It features high performance, low latency , and a low memory footprint. It caches on large (up to 16G) files or raw disk slices, and has squid-like ACLs and bandwidth control. It also has reliable operation and a smooth reconfigure routine.

OOP is widely accepted as being far more flexible than other computer programming languages. OOPs use three basic concepts as the fundamentals for the programming language: classes, objects and methods. Additionally, Inheritance, Abstraction, Polymorphism, Event Handling and Encapsulation are also significant concepts within object-oriented programming languages that are explained in online tutorials describing the functionality of each concept in detail. Object Oriented Programming Introduction
Object Oriented Programming, also known as OOP, is a computer science term which is used to describe a computer application that is composed of multiple objects which are connected to each other. Traditionally, most computer programming languages were simply a group of functions or instructions. With OOP, every object can handle data, get messages, and transfer messages to other objects. The objects will all act as independent units in their own right, and they will be responsible for carrying out a certain process. Because the objects are not dependent on each other, OOP is seen as being more flexible than older methods of programming. It has become quite popular, and it is now used in a number of

advanced software engineering projects. Many programmers feel that object oriented programming is easier for beginners to learn than previous programming methods. Because it is easier to learn, it can also be analyzed and maintained without a large amount of difficulty. However, there are some people that feel that OOP is more complicated than older programming methods. To understand object oriented programming, there are a few concepts you will need to become familiar with. The first concept that you will need to learn is called a "class." A class creates the attributes of a thing, and it will also define the processes that the thing can carry out. For example, a class called "cats" will have the attributes which are commonly found with cats, such as the ability to purr. A class will bring about modularity within the objected oriented computer application. Someone who is not a programmer should be able to find a class. The reason for this is because the attributes of the class should be something that will make sense to them. It is also important for the code of a class to be self contained to a certain degree. When code is written with relevant names, it will be easier to understand. Making sure the code is self-contained will allow one part of the application to be updated without needing to change the other parts. It is this modularity that makes OOP an effective programming method. It will also help the application solve the problems that it was designed for. The next concept that you will want to become familiar with is an "object." An object can be defined as a specific instance of a class. As an example, while the class Cats will provide all the attributes that are found in all cats, the "object" named Betsy is a specific cat. While it shares the same attributes which are found in all cats, it has fur with a unique color. In object oriented programming, a programmer would say that the object Betsy is a run-time instance of the class Cats. A class may also be devided into sub-groups. Certain variations of a class may not be a specific object. The class Cats may have a sub-group which consists of multiple cat breeds. For example, if Betsy were a Persian cat, it would be an instance of the Persian cat sub-group. Every object within an OOP language will share some attributes with the parent class, but it will also have unique attributes as well. The next concept that you will want to become familiar with is "method." A method may also be called a "message" and can be defined as the abilities of an object. Because Betsy is a cat, Betsy can purr. Because of this, "purr" is a method that Betsy has.
Betsy may have a number of other methods. When a method is used within an obj ect oriented programming language, it will only affect a single object. This is true even if the method is designed for the entire class. While all cats can purr, you will only need one cat to do it. Methods can further be broken down into commands, callbacks, or queries. A query will tell you about the state of the object, and a command will cause that object to carry out a task. A callback is a method that is composed of a part within an object. The part will notify its parent that an event has taken place, and the object may need to react to the event.

Object Oriented Programming Concepts

Three of the most basic concepts for object oriented programming are Classes, Objects, and Methods. However, there are a few more concepts that you will want to become familiar with. These are Inheritance, Abstraction, Polymorphism, Event, and Encapsulation. In this article, I will be using the class Cats as an example. Inheritance will allow a sub-group to make a connection with the associates of its parent class. For example, lets say the class Cats decides to create a method called purr() and a property named Colorfur. As the name implies, a property is a specific attribute which is connected to an object. Every sub-group will be able to inherit the associates, and this means the developer only needs to create the code for them one time. The traits that are inherited by the sub-group can be changed. For example, the Persian cat class may choose to make the Colorfur white for their default color. In contrast, another cat breed may choose a different Colorfur trait. It is also possible for the subgroup to add new associates. If a specific cat Class sub-group wants to set a default eye color, this can be inherited as well. Some object oriented programming languages may also allow a class to inherit traits from multiple ancestors, and this is called multiple inheritance. Some programs may not allow this. The next concept that you will want to be familiar with is called "abstraction." Abstraction can be defined as the process in which an application will ignore the characteristics of a sub-group and work on a general level when it is needed. As an example, Betsy the cat may be treated as a cat when it is necessary, but she may also be processed as a Felidae, which is a superclass of cat family. Polymorphism is an important concept of object oriented programming that you will want to become familiar. It can be defined as a behavior which is dependent on the class to which it is connected. As an example, if a Cat is sent a command to speak, this may cause it to purr, while a dog will bark, or a lion may roar. Anyone who is interested in object oriented programming will also need to know encapsulation. Encapsulation will allow a class to hide information from objects that may use the code. For example, the Cat class will have a purr() method. A code will be written which will explain how the cat purrs. Despite this, it is not necessary for Betsy the cat to know how she purrs. Encapsulation makes it easier for the developer to change the code without having to change the code for Betsy. When the structure of class is hidden, it is harder for it to be used in the wrong way. Encapsulation will basically state which class is allowed to use the members of a certain object. This concept makes it easier for programmers to deal with or avoid errors when developing a program. The members within OOP can be categorized as being protected, public, or private. The last concept that you will want to become familiar with is called an event. An event can simply be defined as anything that happens to an object. Generally, an event is something that will cause the object to react with a method. Another term that advanced programmers may run into is called multiple inheritance. It is a situation where a class is able to inherit traits from a number of different superclasses. A multiple inheritance can create a number of perplexing situations. Because of this, there is

debate in the programming community about whether it is beneficial or risky. One example of a program which deals with multiple inheritances is Java.

The History of Object Oriented Programming


The basis for OOP started in the early 1960s. A breakthrough involving instances and objects was achieved at MIT with the PDP-1, and the first programming language to use objects was Simula 67. It was designed for the purpose of creating simulations, and was developed by Kristen Nygaard and Ole-Johan Dahl in Norway. They were working on simulations that deal with exploding ships, and realized they could group the ships into different categories. Each ship type would have its own class, and the class would generate its unique behavior and data. Simula was not only responsible for introducing the concept of a class, but it also introduced the instance of a class. The term "object oriented programming " was first used by Xerox PARC in their Smalltalk programming language. The term was used to refer to the process of using objects as the foundation for computation. The Smalltalk team was inspired by the Simula 67 project, but they designed Smalltalk so that it would be dynamic. The objects could be changed, created, or deleted, and this was different from the static systems that were commonly used. Smalltalk was also the first programming language to introduce the inheritance concept. It is this feature that allowed Smalltalk to surpass both Simula 67 and the analog programming systems. While these systems were advanced for their time, they did not use the inheritance concept. Simula 67 was a groundbreaking system that has inspired a large number of other programming languages, and some of these include Pascal and Lisp. By the 1980s, object oriented programming had become prominent, and the primary factor in this is C++. Object oriented programming was also important for the development of Graphical user interfaces. The Cocoa structure that exists within Mac OS X is a good example of a dynamic GUI that works with an object oriented programming language. This paradigm of programming has also played an important role in the development of event-driven programming. Niklaus Wirth and his associates were looking at areas such as modular programming and data abstraction, and they developed two systems which incorporated these elements. These two systems are Oberon and Modula-2. Oberon used a unique approach to classes and object orientation that is much different than C++ or Smalltalk. Since the introduction of OOP, a large number of modern programming languages are now using the concept. Some of these are Fortran, BASIC, and Pascal. There have been some compatibility issues, because many programs were not designed with a OOPs approach in mind. Object oriented programming languages that were "pure" did not have many of the functions that programmers needed. To solve these problems, a number of researchers have been attempting to design new programming languages that used object oriented concepts but still retained many of the functions that programmers needed. One example of a programming language that has achieved

this to some degree is Eiffel. Another programming language that has attempted to solve this problem is Java. Java has become popular because it uses a virtual machine, and it is very similar to C++ and C. The virtual machine is important because it allows code to be run on multiple platforms without having to be changed. Another system that is similar is Microsoft's .NET. Many developers now understand the importance of OOP, and are actively using it within their own programs. Many researchers have continued to make advancements by using the object oriented approach. There are a number of other languages that have successfully combined the object oriented approach with procedures that are useful to programmers. Python is one example, and Ruby uses a similar approach as well.
The use of an object oriented approach has led to advancements in modeling languages, design patterns, and a number of other areas. It is likely that OOP is a programming paradigm that will continue to evolve as we move forward into the future. It is a powerful language which has continued to improve over the years. It is the subject of debate within the programming community, as critics point out a number of problems with the structure. However, the popularity of programming languages such as Java demonstrate that it is a paradigm that is here to stay.

Understanding Classes Within Object Oriented Programming


To fully understand object oriented programming, you will want to be familiar with classes. When you look at the world around you, it will become obvious that many objects are the same type. For example, the car you drive is just one of the millions of cars that exist in the world. In the OOP terminology, the car you drive is an instance of the class cars. Each car will have a state, and it will have behavior as well. However, the state and behavior of one car is not dependent on the state and behavior of other cars. An example of a behavior a car will have is braking, while the state of the car could be having four wheels. In the object oriented programming, it is possible to have a large number of objects of the same type that have a number of identical attributes. An example of these objects could be video clips or rectangles. The advantage of processing objects which are the same type is that you can generate a diagram for them. This diagram is called a "class." So, the class is a diagram that contains the methods and variables which are related to a specific group of objects. For example, the class of a car would provide the variables that would allow all cars to have a state. In addition to this, the class would also provide information that is related to the methods that will allow changes to take place in the car. Once the car class has been created, it will be possible for you to create a large number of car objects from this class. Once the instance of the car class has been created, it is the responsibility of the system to generate enough memory for the object and its variables. Every instance will be given a copy of the variables that have been created in the class. For example, MyCar and YourCar would be separate instances, but both would be part of the same class, which is cars. They will have values for the variables which will differ from each other. Not only can instance

variables be created, but instances can be created for the class itself. The class variable will hold information that will be held by every instance of a class. As an example, imagine if all cars have the same brake systems. In this situation, creating an instance variable to contain the brake systems is not effective. Every instance would need to have a separate copy of the variable, even though the value will be equal. In this situation, you will want to create a class variable that will hold the same brake system, and every instance will have this variable. When a single object alters the variable, this change will become evident in all the other objects. It is also possible for a class to define class methods. Class method can be generated from a class, but you will need to generate an instance method on a specific instance. Objects have powerful advantages because they have modularity and the ability to hide information. Classes are powerful because they can be reused. Just a car companies use the same diagram to build cars multiple times, computer programmers will use an identical class multiple times to create a large number of objects. If you have read about objects, you may notice the similarities between them and classes. Many people who study object oriented programming become confused when dealing with classes and objects. In the real world, the difference between classes and objects is obvious. For example, you can tell the difference between a car diagram and an actual car. However, when you are dealing with software, the differences aren't always easy to spot. One reason for this is because objects which exist in software are the electronic versions of objects that exist in the real world. In addition to this, the word "object" is often used to talk about a class or an instance. An object can be categorized under a large number of classes. While some of these classes may be specific, others could be more generalized. For example, a Bloodhound would be a specific dog class. However, it could be processed in a larger class such as scenthound, or a larger superclass like Canidae

The Inheritance Concept In OOPs


In object oriented programming, objects will be characterised by classes. It is possible to learn a lot about an object based on the class it belongs to. Even if you are not familiar with the name Maybach, If I told you it is a car, you would immediately know that it has four wheels, an engine, and doors. Objected oriented programming takes this concept to a whole new level It permits classes to be defined in relation to other classes. For example, sedans, sports cars, and roadsters are all types of cars. In the object oriented language, sports cars, sedans, and roadsters are subclasses of the class cars. The class cars is a "superclass" of sedans, roadsters, and sports cars. Every subclass will inherit a state from the superclass. The various types of cars such as sedans and roadsters will share certain behaviors such as braking. Despite this, subclasses are not restricted to the behaviors and states that they have taken from their superclass. A subclass can combine methods and variables

with the traits they have inherited from their superclass. For example, while a sedan may have four dours, sports cars will generally have two. It is also possible for subclasses to override any methods that they have inherited, and they can create unique implementations for these methods. As an example of this, you can "override" certain traits within a car to allow it to do different things. It is also possible to use more than just one level of inheritance. An inheritance structure can be generated which can be as deep as you want it to be. This inheritance structure is called a class hierarchy. The variables and methods can extend through the levels of the class hierarchy. In most cases, a hierarchy that is deep tends to have behaviors which are distinct. However, there are a number of important things you should know about a class hierarchy. It should always define what the classes are instead of how they are used. For example, if you are implementing a class for muscle cars, it may be helpful to set it up as a subclass of the class cars. The reason for this is because muscle cars are a subgroup of the class cars that have large amounts of power. At the same time, because a muscle car is a subgroup of the class cars, you would not want to connect them together directly. If you do this, you may confuse those that use your program. They may become confused because the muscle car could have methods that are not necessary, and this could make it difficult to handle the application. The object class should be at the zenith of the class hierarchy. Every class should descend from it in a direct or indirect manner. The variable of an object type can retain a reference for any object, and an example of this would be a class. For example, the object could define behaviors that may be attributed to the objects that are processed by the Java Virtual Machine. There are a number of power advantages to the concept of inheritance. Subclasses can generate distinct behaviors which are based on the common attributes that are present in their superclass. Because of inheritance, it is possible for programmers to use the same code many times over. In addition to this, programmers can generate superclasses which are named abstract classes. Abstract classes will characterise behaviors which are common. While some aspects of this behavior may be defined, a large portion of it will not be defined at all. This will allow other developers to fill in the blank spaces with unique subclasses. As you can see, an inheritance is extremely important. It shows how subclasses are connect to their superclasses, and it can also allow you to understand which traits have been passed from the superclass to its subclasses. It is one of the most powerful features of object oriented programming. It is used in a number of popular programming languages such as Java. It is features like this that makes OOP a powerful tool that many programmers use to create important programs. However, it is just one of the few concepts that you must understand if you wish to use this programming paradigm.

You might also like