860 likes | 1.85k Views
Object Oriented Paradigm. Object Oriented(O-O) Paradigm. Not language-specific, but a new way of looking at software development Focus on objects as encapsulations of state plus behavior with tight, yet clear, interfaces. Object-orientation stresses on: Information hiding Reusability
E N D
Object Oriented(O-O) Paradigm • Not language-specific, but a new way of looking at software development • Focus on objects as encapsulations of state plus behavior with tight, yet clear, interfaces. • Object-orientation stresses on: • Information hiding • Reusability • New analysis and design methodologies • New style of programming
1967 Early 1980s Late 1980s 1990s Simula Smalltalk C++ Objective-C Eiffel JAVA Visual Basic History Of O-O Programming
Object • Object: An object is an instance which is present at execution time and allocates memory for its instance variables, and which behaves according to the protocol of its class. • Any real world objects can be considered as an object in programming sense. • All objects are instances of a class. • For an example: Chair. Chair is a member or an instance of a much larger class of objects that we call furniture.
Class • Class: A class describes structure and behavior of a set of similar objects. • Furniture is the class in this case. • Each class has a generic attributes that can be associated with every object. • The class furniture would have attributes like: cost, dimensions, weight, location, and colors. • Every object in the Furniture class will inherit all the attributes defined.
Class Furniture • A class will contain class name, attributes, and operations. • Class name: Furniture. • Attributes: Cost, dimensions, location, and color. • Operation: Buy, Sell, and weigh. Class: Furniture Attributes: Cost Dimensions Location Color Object: Chair Cost Dimensions Location Color Operations: Buy Sell Move Buy Sell Move
Operations/Message • Operations: The behavior of the objects. • Operations are also known as functions, procedures, or methods. • Each operation is defined in the class. • A message passes an object the information on the activity it is expected to carry out, thus requesting it to perform an operation.
O-O Characteristics • Encapsulation and Information Hiding • Classification and Abstract Data Type • Polymorphism through inheritance Object-Oriented Triangle Polymorphism O-O system Encapsulation Abstraction
Encapsulation and Information Hiding • Encapsulation: Be able to modularize codes. • Information Hiding: Be able to limit data access from other modular. • “Decide which modules you want; partition the program so that data are hidden in modules.” May 1988, IEEE Software.
Abstraction and Classification • Abstract Data Type(ADT): has the idea of allowing the users to define their own type and use it just as if it were a basic language type, “user-defined type.” • Classification: is the idea of grouping software ideas into classes of things.
Inheritance • Inheritance: a class (subclass) inherits all of the entities (variables and methods) of it’s parent class. • Inheritance is one of the key differentiators between conventional and OO systems. • An inheritance structure is one of the ways of offering reusability, extendibility, and lower maintenance.
Disadvantages: Execution Speed Program Size Message-Passing Overhead Program Complexity Advantages: Software Reusability Increased Reliability Code Sharing Software Components Polymorphism Information Hiding Inheritance cont.
Polymorphism/Dynamic Binding • Polymorphism means that an operation may behave differently (in different classes). • Dynamic Binding: allows the use defer binding until run-time.
References • [Budd, 2000] Budd, T., Understanding Object-Oriented Programming with Java, Addison-Wesley, 2000. • [Bruegge, 2000] Bruegge, B., Dutoit, A., Object-Oriented Software Engineering, Prentice Hall, 2000. • [Larman, 1998] Larman, C., Applying UML and Patterns, Prentice Hall, 1998. • [Henderson-Sellers, 1992] Henderson-Sellers, B., A Book of Object-Oriented Knowledge,Prentice Hall, 1992.
Reference Cont. • [Oestereich, 1999] Oestereich, B., Developing Software with UML: O-OA and OOD in Practice, Addison Wesley, 1999. • [Pressman, 2001] Pressman, R., Software Engineering, 5th ed., McGraw-Hill, 2001. • [Schach, 1999] Schach, S., Classical and Object-Oriented Software Engineering, 4th ed., McGraw-Hill, 1999. • [Yourdon, Argila, 1996] Yourdon, E., Argila, C, Case Studies in Object-Oriented Analysis & Design, Prentice Hall, 1996.