Introduction to Object Oriented Programming and Design Patterns
6/20/2000
By Austin V. Huang
Purpose
To give a clear introduction to the fundamental ideas of Object Oriented Programming and introduce the new topic of design patterns.
Presentation Outline
I. Introduction/Purpose: provide a solid foundation of OOP, introduce design patterns
II. Fundamental concepts of OOP
A. Definitions/relationships – classes, objects, methods, data
B. Examples demonstrating these relationships
C. Inheritance – "Is-A" relationships, concept of polymorphism
D. What are the advantages of using OOP?
III. Design patterns
A. Motivation
B. What are design patterns
C. Simple examples of design patterns
IV. Conclusion
Big Ideas
- The concept of abstraction is a principal theme of this lecture and of computer science in general. The higher the level of abstraction, the closer we are to a logical view of the problem, i.e. we solve the problem the way the human brain solves the problem. The lower the level of abstraction we are at, the more "computer-related" considerations we need to use. OOP can be considered a level of abstraction above procedure oriented programming, and in fact, if the language is flexible enough OOP can be implemented within a non-OOP language (LISP is a language capable of this, C is a language that is not). OOP is meant to organize a problem more closely to how the human brain solves problems by encapsulating data and functions that are related into objects rather than spreading them out and relying on the programmer to manage them (which is the case in procedure oriented programming). Our second subject, design patterns, can also be thought of a level of abstraction. Here, rather than designing class structures from scratch, we think of a system in terms of combinations of patterns. We can then speak of program design while abstracting out individual classes. This can be thought of as being analogous to the way we don't talk about the local variables involved if we call a function, only caring about the precondition and postcondition.
- What is a design pattern? A design pattern "is a solution to a problem in a context" – GoF. More specifically, a design pattern is a named description of object relationship that gives a flexible and generalized solution to a class design problem that arises over and over again in Object Oriented software engineering.
- What is the ultimate purpose of OOP and design patterns? The ultimate purpose is to make programs that are more flexible, while cutting down on design time by solving the problem at a higher level of abstraction.
The definitive book on Design Patterns, "Gang of Four":
Design Patterns: Elements of Reusable Object Oriented Software by Erich Gamma, Rich Helm, Ralph Johnson, John Vlissides. Addison-Wesley.
References:
Java Tutorial
Polymorphism
The Java Design Patterns Tutorial
Design Patterns
Contact:
Email: austin_huang@hotmail.com
Document Converted from word 8 by
MSWordView
MSWordView written by Caolan McNamara