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 object 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.