Technical Paper



Yüklə 16,71 Kb.
tarix08.08.2018
ölçüsü16,71 Kb.
#61159

Technical Paper

"Our goal is to help programmers construct program of high quality - programs that reliable, efficient, and reasonably easy to understand, modify, and maintain."

Rosy Upreti, SWE 619, George Mason University

rupreti@masonlive.gmu.edu

Abstract

With the growing globalization in software development, there are large numbers of programs that have been designed to address the demand of the clients. However, the lack of organization, consistency, flexibility and deeper understanding of the problems in a program result in the short life and failure of the software projects. This paper is an attempt to describe some essential features of an object oriented programming language that can contribute in the construction of a high quality program and highlight their importance in the context of software engineering.



Encapsulation

Encapsulation is the mechanism of combining the code and the data and manipulating it into the single unit. It provides the layer of security around manipulated data and protects it from the external interference and misuse [1]. The best example of an encapsulation is a class that encapsulates the features such as method and instance variables within itself and can only be accessed by creating the object of that class. This is an important feature to be considered while constructing the high quality program as it provides us with an ability to modify our implemented code without breaking the code of others who use it and also contributes to toward the maintainability, extensibility and flexibility to our code.



Data Abstraction

Data abstraction is the design technique that focuses on the essential features without including the implementation details [1]. Also, the data abstraction is the essential characteristic that allows the program –data independence and program operation independence.

Lets us take an example: Consider a project that contains the group of persons who are responsible for creating the class and the other group of programmers who develop the software application through the use of those collections of classes. In this case, the objective of a group of person who are responsible for creating the classes is to expose only those classes that are necessary for the programmers and keep everything else hidden. As a result of which it is possible for the class creators to change their hidden requirements without worrying about its impact to the programmer. The hidden portion generally consists of the very important information that could be damaged by the programmer due to misunderstanding and carelessness. Therefore, hiding the information prevents the program from being corrupted and reduces bugs and errors.

Abstraction has two different forms which are called object and Abstract Data Types (ADT). Both of them can implement an abstraction in the simple way without complex method but object are extensible and abstract data type are easier to verify [2].



Decomposition

Decomposition is the design technique that manages the abstractions and creates the component that can be developed effectively [3]. It is very hard to manage the large and complex problem, so, dividing the problems into smaller number of modules and working on them independently can help us achieve our goals. Decomposing a problem factors it to simple problem in such a way that each sub problem is at the same level of detail, can be solved independently and the solution to the subproblems can be combined to solve the original sub problem [4] .lets us consider Liskov’s example of sorting using the merge sort. In the merge sort, we break the problem of sorting a list of random size into two simpler problems, sort two different sub problems independently and finally merge them together into a single sorted list[4]. This feature of decomposition is the useful technique as it provides us with the clear vision about how the individual problem will look like and helps us merge them together into larger problems. However, the proper understanding of the problem is of vital importance while applying the feature of decomposition. It becomes very hard to decompose the large and poorly understood problem. Reminding you again with Liskov’s [4] example of creating a play by assembly of writers, without having understood their roles in the play. Creating an individual component that solves the stated sub problem but do not combine to solve the stated original problem makes the system integration difficult. Hence, as described earlier, abstraction provides us with the good way of decomposing the problem by changing the level of details to be considered .Alternating between these two process of abstraction and decomposition until we reduce the original problem into a set of sub problems that we already know how to solve can help us construct the program of high quality [4].



Polymorphism

Polymorphism is the bottom up method call procedure that provides us with ability for the different objects to response to the same message in different ways [1]. This feature provides us with the benefit of adding new classes of derived object without breaking the code. Object oriented programming language implements polymorphism by the process called dynamic binding. Through the use of polymorphism in a program, we can redefine a method within a derived class. Lets us consider an example: Consider a library management system in the university which contains student and faculty as the sub classes of the library system. Given those sub classes, it is possible for the programmer to define getfine () methods in student and faculty to override the default getfine () that is held in the library class.

The main advantage of polymorphism is that it simplifies the programming interface. Instead of creating a new name for the new function you add to a program, same name can be reused, thus helping us construct the programs which are reliable, efficient and reasonably easy to understand.

Inheritance

The process that allows the extension or reuse of the existing code without having to repeat or rewrite the code from the scratch is called inheritance[1]. It includes the behavior (methods) and state (variables) of the base class in a derived class so that they can easily be accessible to the derived class. The new derived class not only inherits the members of the base class but also add its own. For example : In an inventory management system, there are customers , of which we keep the information such as name, address etc and the subclass of customer may contain the students, where not only we keep track of the name and address but also store the educational background of the student.

Inheritance, if we can do in an organized and system manner is a clean way of modifying the behavior but maintaining the re-usability. Any shared pieces of the logic can be moved from base class to a derived class to improve the maintainability of the code by avoiding the code duplication. The existing class is called super class and the derived class is called subclass. As mentioned earlier sub class can override the methods and provides its own implementation that may differ from the super class. The key point to be considered in this case is whether a class have a multiple inheritance. There are lots of complex design issues involved. However, inheritance does not tend to create dependencies between the classes, negatively impacting reusability.

Conclusion

While there exists many techniques that helps the programmer in the construction of high quality program, the above mentioned features are just an attempt to make you familiar with some of the important concept of an object oriented design which when implemented in the program helps us in assessing the high quality code thereby improving the reliability, efficiency, maintainability, modifiability and flexibility of a program.



References

[1] http://www.buyya.com/java/Chapter1.pdf



[2] William R. Cook, On Understanding Data Abstraction, Revisited, University of Texas at Austin.
[3] Hung-Fu Chang, Decomposition and Traceability in Software Design, University of Southern California, Los Angeles, CA, USA
[4] Barbara Liskov, John Guttag, Program Development in Java, 2nd edition
Yüklə 16,71 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə