Object-Oriented Modeling and Design

Slides:



Advertisements
Similar presentations
Postgraduate Computing Lectures OO Concepts 1 Object Oriented Programs: Basic Concepts Nick West.
Advertisements

Software Engineering Class design. Class design – ADT Abstract Data Types:  Why use ADT? Hidden implementation details Changes do not affect whole program.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Object-Oriented.
Software Engineering and Design Principles Chapter 1.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Immutable Objects and Classes.
Introduction to Computers and Java Recitation - 01/11/2008 CS 180 Department of Computer Science, Purdue University.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
1 Chapter 6 Inheritance, Interfaces, and Abstract Classes.
Advanced Object-Oriented Programming Features
Chapter 1 Principles of Programming and Software Engineering.
1 Object-Oriented Design. 2 Objectives F To become familiar with the process of program development. F To the relationship types: association, aggregation,
Chapter 1 Software Engineering. Homework ► Read Section 2.2 (pages 79-98) ► Answer questions: ► 7, 8, 11, 12, & 13 on page 134. ► Answer on paper, hand.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
Chapter 13: Object-Oriented Programming
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
Algorithm Programming Coding Advices Bar-Ilan University תשס " ו by Moshe Fresko.
Computer Science 240 Principles of Software Design.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented Design.
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
Introduction to Object-oriented programming and software development Lecture 1.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
An Object-Oriented Approach to Programming Logic and Design
“Enhancing Reuse with Information Hiding” ITT Proceedings of the Workshop on Reusability in Programming, 1983 Reprinted in Software Reusability, Volume.
CHAPTER ONE Problem Solving and the Object- Oriented Paradigm.
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
Chapter 9 Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
1 Life Cycle of Software Specification Design –Risk Analysis –Verification Coding Testing –Refining –Production Maintenance.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
Object-Oriented Design CSC 212. Announcements This course is speeding up and we are starting new material. Please see me if you feel this is going too.
Data Abstaraction Chapter 10.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Program Style Chapter 22 IB103 Week 12 (part 2). Modularity: the ability to reuse code Encapsulation: hide data access directly but may use methods (the.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
Chapter 1 Introduction Visual Basic.NET. Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi 2 Objectives Explain what Visual Basic is Contrast.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Chapter 2 Principles of Programming and Software Engineering.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
CSCE 240 – Intro to Software Engineering Lecture 3.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Fall 2013 Chapter 10 Thinking.
Unit 10 Code Reuse. Key Concepts Abstraction Header files Implementation files Storage classes Exit function Conditional compilation Command-line arguments.
Principles of Programming & Software Engineering
OOP: Encapsulation &Abstraction
Chapter 11 Object-Oriented Design
Principles of Programming and Software Engineering
TIM 58 Chapter 8: Class and Method Design
Object Oriented Analysis and Design
Chapter 2. Problem Solving and Software Engineering
Object-Oriented Programming
Software Development Chapter 1.
C++ Object Oriented 1.
Chapter 9: Implementation
Presentation transcript:

Object-Oriented Modeling and Design Programming Style Chapter 14 Part 3: Implementation Object-Oriented Modeling and Design Byung-Hyun Ha bhha@pusan.ac.kr

Lecture Outline Introduction Object-Oriented Style Reusability Extensibility Robustness Programming-in-the-large

Introduction The experienced programmer follows principles to make readable programs that live beyond the immediate need Good style is important in all programming, but it is even more important in OO design and programming because much of the benefit of the OO approach is predicated on producing reusable, extensible, understandable programs

Object-Oriented Style Reusability Extensibility Robustness Programming-in-the-large

Reusability Kind of reusability Style rules for reusability Sharing of newly-written code within a project Reuse of previously-written code on new projects Style rules for reusability Keep methods coherent Keep methods small Keep methods consistent Separate policy and implementation Provide uniform coverage Broaden the method as much as possible Avoid global information Avoid modes

Reusability Using inheritance Subroutines Factoring Delegation Encapsulate external code

Extensibility OO principles for extensibility Encapsulate classes Hide data structures Avoid traversing multiple links or methods Avoid cast statements on object type Distinguish public and private operations

Robustness Guidelines for robustness Protect against errors User errors and low-level system errors Programming bugs Optimize after the program runs Validate arguments Avoid predefined limits Instrument the program for debugging and performance monitoring

Programming-in-the-large Guidelines Do not prematurely begin programming Keep method understandable Make methods readable Use exactly the same names as in the object model Choose name carefully Use programming guidelines Package into modules Document classes and methods Publish the specification

Appendix: OO and Programming We already discussed… Farm toString() and priority queue Window programming They cannot be possible without inheritance and polymorphism If you want to prepare those functionalities in the examples, you should consider the use of OO concepts Otherwise, your program will never be understandable (even for yourself), extensible, and reusable

Appendix: OO and Programming Inventory example Inventory simulation Assumptions Two types of suppliers Three types of demands Two types of policies Two ways of displaying results If you want to carry out simulation for every possible combination of settings, you have to write 24 (= 2x3x2x2) programs Too complex to write and manage Let’s make them using one program (Inv_manage1.java) How about it? Could you understand? Do you think you can easily extend the program?

Appendix: OO and Programming Inventory example (cont’) Let’s use OO concepts (Inv_manage2.java, …) First of all, easy to understand Coherent, small, clear, consistent, extendible, reusable, … Inv_manage Supplier Demand Policy Display put_order today_deliever today_demand today_order show

Appendix: OO and Programming Tree example Tree traversal with different purposes Structural way (Tree1.java) We should implement traversal algorithm every time we need OO way (Tree2.java) Don’t care about how to traverse, only need to write what to do 1 2 2 3 5 7 4 5 6 2 1 3