Anda di halaman 1dari 3

These are some of the major advantages of OOP.

Simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear. Modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system. Modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods. Extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones. Maintainability: objects can be maintained separately, making locating and fixing problems easier. Re-usability: objects can be reused in different programs. OOP provides a clear modular structure for programs which makes it good for defining abstract datatypes where implementation details are hidden and the unit has a clearly defined interface. OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces. component-specific behavior - making details on how to handle a particular component the responsibility of the smaller component-specific machine ensures any time that component is handled, its machine will do so appropriately; polymorphic expressions - because component-specific machines performs operations tailored to its particular component, the same message sent to different machines can act differently; type abstraction - it often makes sense for several different types of components to use the same vocabulary for the operations their machines do; separation of concerns - leaving component-specific details to their machines means the process machine only needs to handle the more general, larger concerns of its process and the data required to manage it; plus, it's less likely to be affected by changes in other components;

adaptability - components that focus on their area of speciality can be adapted to unforeseen use simply by changing the components it uses, or making it available to another process machine; code reuse - components with a narrow focus and greater adaptability can leverage their development cost by being put to use more often. Code Reuse and Recycling: Objects created for Object Oriented Programs can easily be reused in other programs. Encapsulation (part 1): Once an Object is created, knowledge of its implementation is not necessary for its use. In older programs, coders needed understand the details of a piece of code before using it (in this or another program). Encapsulation (part 2): Objects have the ability to hide certain parts of themselves from programmers. This prevents programmers from tampering with values they shouldn't. Additionally, the object controls how one interacts with it, preventing other kinds of errors. For example, a programmer (or another program) cannot set the width of a window to -400. Design Benefits: Large programs are very difficult to write. Object Oriented Programs force designers to go through an extensive planning phase, which makes for better designs with less flaws. In addition, once a program reaches a certain size, Object Oriented Programs are actually easier to program than non-Object Oriented ones. Software Maintenance: Programs are not disposable. Legacy code must be dealt with on a daily basis, either to be improved upon (for a new version of an exist piece of software) or made to work with newer computers and software. An Object Oriented Program is much easier to modify and maintain than a non-Object Oriented Program. So although a lot of work is spent before the program is written, less work is needed to maintain it over time.

Disadvantages of Object Oriented Programming

Size: Object Oriented programs are much larger than other programs. In the early days of computing, space on hard drives, floppy drives and in memory was at a premium. Today we do not have these restrictions. Effort: Object Oriented programs require a lot of work to create. Specifically, a great deal of planning goes into an object oriented program well before a single piece of code is ever written. Initially, this early effort was felt by many to be a waste of time. In addition, because the programs were larger (see above) coders spent more time actually writing the program. Speed: Object Oriented programs are slower than other programs, partially because of their size. Other aspects of Object Oriented Programs also demand more system resources, thus slowing the program down. Not all programs can be modeled accurately by the objects model. If you just want to read in some data, do something simple to it and write it back out, you have no need to define classes and objects. However, in some OOP languages, you may have to perform this extra step.

Another disadvantage is that if you force the language into the OOP concept, you lose some of the features of useful languages like the "functional languages." Another disadvantage is that one programmer's concept of what constitutes an abstract objects.

Object Oriented Databases

Store data together with the appropriate methods for accessing it i.e. encapsulation.