Object Oriented Programming Essay, Research Paper
Introduction
Object Orientation has become more and more important in the last years. Object oriented programming was designed for re-use of codes. It is a type of programming in which programmers define not only the data structure, but also the types of operations that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects. One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.
Object oriented language uses the following concepts
Classes, Objects, Instance variables and Methods.
Basically everything in object orientation is considered an object, except for the primitive data types: There are mainly three groups of primitive data types: numeric types, Boolean types and arrays. Objects contain attributes and methods.
The attributes of an object are just like Adjectives in the English language. The attributes describe the objects like adjectives describe the nouns. A class is determined by common attributes, all objects falling under this category of common attribute belong to that class.
Methods are like verbs, they describe the action or task performed by the object Since objects are the fundamental building blocks they can inherit attributes and methods from their parent class. Objects can also collaborate with each other.
Inter-phases
Objects can have: public interphase, private interphase.
Inheritance
If there is already a class which can respond to a bunch of different messages, and if you wanted to make a new, similar class which adds just a couple of more messages you do not have to re-write the entire class. All you need to do is create a subclass of the original class. This new class inherits all the existing messages, and therefore, all the behavior of the original class. The original class is called the parent class, or superclass, of the new class. Some more jargon– a subclass is said to be a specialization of its superclass, and the conversely a superclass a generalization of its subclasses. Inheritance also promotes reuse. You don’t have to start from scratch when you write a new program. You can simply reuse an existing repertoire of classes that have behaviors similar to what you need in the new program. Much of the art of object-oriented programming is determining the best way to divide a program into an economical set of classes. In addition to speeding development time, proper class construction and reuse results in far fewer lines of code, which translates to less bugs and lower maintenance costs.
Object-Oriented Languages
There are almost two dozen major object-oriented programming languages in use today. But the leading commercial object-oriented languages are far fewer in number. These are:
C++, Smalltalk, Java
C++
C++ is an object-oriented version of C. It is compatible with C, so that existing C code can be incorporated into C++ programs. C++ programs are fast and efficient, qualities which helped make C an extremely popular programming language. It sacrifices some flexibility in order to remain efficient, however. C++ uses compile-time binding, which means that the programmer must specify the specific class of an object, or at the very least, the most general class that an object can belong to. This makes for high run-time efficiency and small code size, but it trades off some of the power to reuse classes. C++ has become so popular that most new C compilers are actually C/C++ compilers. However, to take full advantage of object-oriented programming, one must program in C++, not C. This can often be a major problem for experienced C programmers. Many programmers think they are coding in C++, but instead are only using a small part of the
language’s object-oriented power.
Smalltalk
Smalltalk is a pure object-oriented language. While C++ makes some practical compromises to ensure fast execution and small code size, Smalltalk makes none. It uses run-time binding, which means that nothing about the type of an object need to be known
VisualWorks from ParcPlace-Digitalk, Inc.
Smalltalk/V & Visual Smalltalk from ParcPlace-Digitalk Inc.
VisualAge from IBM
VisualWorks
VisualWorks is arguably the most powerful of Smalltalks. VisualWorks was developed by ParcPlace, which grew out of the original Xerox PARC project that invented the Smalltalk language. VisualWorks is platform-independent, so that an application written under one operating system, say, Microsoft Windows, can work without any modification on any of a wide range of platform supported by ParcPlace, from Sun Solaris to Macintosh. VisualWorks also features a GUI (Graphic User Interface) builder that is well-integrated into the product.
Smalltalk/V and Visual Smalltalk
Digitalk’s versions of Smalltalk are somewhat smaller and simpler, and are specifically tailored to IBM compatible PCs. A Macintosh version was available, but support has since been abandoned. This does not bode well for Digitalk cross-platform
efforts. Digitalk has a separate GUI builder, called PARTS Workbench (bundled with Visual Smalltalk), which allows quick construct of an application. ParcPlace and Digitalk were merged into a single company, ParcPlace-Digitalk, Inc. The future of the Digitalk product line is uncertain, and it may just be spun off back into a separate company.
VisualAge
IBM’s version of Smalltalk, VisualAge, is comparable to Smalltalk/V with PARTS. Both of these Smalltalks allow programmers to readily exploit machine-specific features, at the expense of some portability. IBM has adapted existing industry standards for such things as file management and screen graphics. When IBM talks, people listen, and IBM has made a substantial commitment to Smalltalk.
Java
Java is the latest, flashiest object-oriented language. It has taken the software world by storm due to its close ties with the Internet and Web browsers. It is designed as a portable language that can run on any web-enabled computer via that computer’s Web browser. As such, it offers great promise as the standard Internet and Intranet programming language. Java is a curious mixture of C++ and Smalltalk. It has the syntax of C++, making it is easy to learn, depending on your experience. But it has improved on C++ in some important areas. For one thing, it has no pointers, low-level programming constructs that make for error-prone programs. Like Smalltalk, it has garbage collection, a feature that frees the programmer from explicitly allocating and de-allocating memory. And it runs on a Smalltalk-style virtual machine, software built into your web browser which executes the same standard compiled Java byte codes no matter what type of computer you have. Java development tools are being rapidly deployed, and are available from such major software companies as IBM, Microsoft, and Symantec.
Conclusion
Object-oriented programming offers a new and powerful model for writing computer software. Objects are “black boxes” which send and receive messages. This approach speeds the development of new programs, and, if properly used, improves the maintenance, reusability, and modifiability of software. Object-oriented programming requires a major shift in thinking by programmers, however. The C++ language offers an easier transition via C, but it still requires an o-o design approach in order to make proper use of this technology. Smalltalk offers a pure o-o environment, with more rapid development time and greater flexibility and power. Java promises much for Web-enabling object-oriented
programs.