OOP Review CS 124.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Based on Java Software Development, 5th Ed. By Lewis &Loftus
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Chapter 1 Object-Oriented System Development
Introduction To System Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Object-Oriented PHP (1)
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to Requirements Analysis Object Oriented.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Basic OOP Concepts and Terms
Requirements Analysis 9. 1 OO Concepts b509.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Object.
© Wolfgang Pelz Introduction Object-Oriented Methods: Analysis, Design & Programming Dr. Wolfgang Pelz Dr. Yingcai Xiao The University of Akron.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Software Engineering Principles and C++ Classes
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
Chapter 7 - Generalization/Specialization and Inheritance1 Chapter 7 Generalization/Specialization and Inheritance.
C++ fundamentals.
UML and Object Oriented Concepts
BACS 287 Basics of Object-Oriented Programming 1.
CMPT 275 Software Engineering
Introduction To System Analysis and design
Programming Languages and Paradigms Object-Oriented Programming.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Eclipse – making OOP Easy
Introduction to Object-oriented programming and software development Lecture 1.
An Object-Oriented Approach to Programming Logic and Design
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Object Oriented Design and Programming Alan Goude Room: Sheaf 9323.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Unified Modeling Language, Version 2.0
1. 2 Object-Oriented Concept Class & Object Object-Oriented Characteristics How does it work? Relationships Between Classes Development Tools Advantage.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Programming Languages and Paradigms Object-Oriented Programming.
Introduction to Object Oriented Programming CMSC 331.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Object-Oriented Design Notation CS 123/CS 231. References zMain Reference: UML Distilled, by Martin Fowler ÕChapters 3, 4, 6, and 8 zSupplementary References:
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
 What is Modeling What is Modeling  Why do we Model Why do we Model  Models in OMT Models in OMT  Principles of Modeling Principles of Modeling 
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Software Design CS 123/CS 231. What is Design? zDesign is the activity of specifying a solution to a problem zContrast this against other software engineering.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
Data Structures Using C++ 2E
Object-Oriented Programming Chapter Chapter
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
ISBN Object-Oriented Programming Chapter Chapter
1 Unified Modeling Language, Version 2.0 Chapter 2.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Object-Oriented Programming (Review) CS 123 Key OOP Concepts zObject, Class zInstantiation, Constructors zEncapsulation zInheritance and Subclasses zAbstraction.
CSCI 171 Presentation 15 Introduction to Object–Oriented Programming (OOP) in C++
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Basic Characteristics of Object-Oriented Systems
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object-Oriented Design
About the Presentations
Software Design AITI GP John Paul Vergara.
SNSCT_CSE_PROGRAMMING PARADIGM_CS206
Basic OOP Concepts and Terms
Presentation transcript:

OOP Review CS 124

Object-Oriented Programming Revisited Key OOP Concepts Object, Class Instantiation, Constructors Encapsulation Inheritance and Subclasses Abstraction Reuse Polymorphism, Dynamic Binding Object-Oriented Design and Modeling

Object Definition: a thing that has identity, state, and behavior identity: a distinguished instance of a class state: collection of values for its variables behavior: capability to execute methods * variables and methods are defined in a class

Class Definition: a collection of data (fields/ variables) and methods that operate on that data define the contents/capabilities of the instances (objects) of the class a class can be viewed as a factory for objects a class defines a recipe for its objects

Instantiation Object creation Memory is allocated for the object’s fields as defined in the class Initialization is specified through a constructor a special method invoked when objects are created

Encapsulation A key OO concept: “Information Hiding” Key points The user of an object should have access only to those methods (or data) that are essential Unnecessary implementation details should be hidden from the user In Java/C++, use classes and access modifiers (public, private, protected)

Inheritance Inheritance: Subclass relationship programming language feature that allows for the implicit definition of variables/methods for a class through an existing class Subclass relationship B is a subclass of A B inherits all definitions (variables/methods) in A

Abstraction OOP is about abstraction Encapsulation and Inheritance are examples of abstraction What does the verb “abstract” mean?

Reuse Inheritance encourages software reuse Existing code need not be rewritten Successful reuse occurs only through careful planning and design when defining classes, anticipate future modifications and extensions

Polymorphism “Many forms” Example: Dynamic binding: allow several definitions under a single method name Example: “move” means something for a person object but means something else for a car object Dynamic binding: capability of an implementation to distinguish between the different forms during run-time

Building Complex Systems From Software Engineering: complex systems are difficult to manage Proper use of OOP aids in managing this complexity The analysis and design of OO systems require corresponding modeling techniques

Object-Oriented Modeling UML: Unified Modeling Language OO Modeling Standard Booch, Jacobson, Rumbaugh What is depicted? Class details and static relationships System functionality Object interaction State transition within an object

Some UML Modeling Techniques Class Diagrams Use Cases/Use Case Diagrams Interaction Diagrams State Diagrams

Example: Class Diagram Borrower Book 0..1 0..3 currBorr bk[] public class Borrower { Book bk[]; … public Borrower() { bk = new Book[3]; } public class Book { Borrower currBorr; … }

Example: Use Case Diagram LIBRARY SYSTEM Facilitate Checkout Search for Book Borrower Librarian Facilitate Return

Example: Interaction Diagram 2: isAvailable() Checkout Screen :Book 1: borrowAllowed() 3: borrowBook() 4: setBorrower() :Borrower

Example: State Diagram (Book) start Reserved Borrowed New Librarian activates book as available Borrower returns book Available

Object-Oriented Design Models Static Model Class Diagrams Dynamic Model Use Cases, Interaction Diagrams, State Diagrams, others

OO Static Model Classes and Class Diagrams Relationships Dependencies Association Aggregation/Composition Inheritance Dependencies Attribute and Method names

OO Dynamic Model Goal: Represent Object behavior Object interaction Traditional/Procedural Dynamic Modeling Data Flow Diagrams (DFDs) Problem: Processes separate from data Need modeling notation that highlight tight relationship between data & processes

DFD Example (Inventory Management) Accept and Post Delivery Delivery info Transaction Item Master

OO Counterpart: Object Interaction new (delivery info) Encoder :Transaction post (item count) :Item Master

Building an OO Dynamic Model Identify use cases Describe each use case through an interaction diagram For more complex objects, provide a state diagram per class Derive implied methods (and attributes)

What’s Next? Need to understand the notation Make sure it helps the software development process When to use the UML techniques Primarily when specifying OO design Formal means of communication across the different software development stages