Object-Oriented Modeling Chapter 10 CSCI 1302. CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.

Slides:



Advertisements
Similar presentations
Chapter 10 THINKING IN OBJECTS 1 Object Oriented programming Instructor: Dr. Essam H. Houssein.
Advertisements

Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
CSE 1302 Lecture 8 Inheritance Richard Gesick Figures from Deitel, “Visual C#”, Pearson.
Ch 12: Object-Oriented Analysis
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Object-Oriented.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Object-Oriented.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Immutable Objects and Classes.
UML – Class Diagrams.
Liang,Introduction to Java Programming,revised by Dai-kaiyu 1 Chapter 10 Object-Oriented Modeling.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
Advanced Object-Oriented Programming Features
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
1 Object-Oriented Design. 2 Objectives F To become familiar with the process of program development. F To the relationship types: association, aggregation,
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
Chapter 10 Classes Continued
1 Object-Oriented Modeling Using UML CS 3331 Fall 2009.
Introduction To System Analysis and design
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented Design.
Inheritance using Java
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
An Object-Oriented Approach to Programming Logic and Design
COP3502 Programming Fundamentals for CIS Majors 1 Instructor: Parisa Rashidi.
ITEC 370 Lecture 10 Design. Review Design –Why is it part of the process? –Who is the audience for design?
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Chapter 9 Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design.
Chapter 9 Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 1 Chapter 13 Abstract Classes and Interfaces.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
PROG Object Oriented Programming II With Java PROG Object Oriented Programming II With Java Class Relationships.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI 1100/1202 April 1-3, Program Development The creation of software involves four basic activities: –establishing the requirements –creating.
Chapter 5 Programming with Objects and Classes OO Programming Concepts OO Programming Concepts Declaring and Creating Objects Declaring and Creating Objects.
Chapter 17 – Object- Oriented Design. Chapter Goals To learn about the software life cycle To learn about the software life cycle To learn how to discover.
© 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.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 1 Chapter 13 Abstract Classes and Interfaces.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Object-Oriented Design.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
CLASS DIAGRAMS A classy approach to objects. The Basic Class Diagram  Class Name  Attributes (- indicates private each would have properties or accessor/mutator.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Fall 2013 Chapter 10 Thinking.
Chapter 10 Thinking in Objects
UML Diagrams: Class Diagrams The Static Analysis Model
Chapter 10 Thinking in Objects
Object-Oriented Analysis and Design
Chapter 10 Thinking in Objects
Chapter 11 Object-Oriented Design
Chapter 10 Object-Oriented Modeling
Reference: COS240 Syllabus
Chapter 9 Thinking in Objects
Seminar 3 UML Class Diagram.
Software Engineering Lecture #11.
Chapter 9 Thinking in Objects
CS 112 Programming 2 Lecture 02 Abstract Classes & Interfaces (2)
Software Development Process Using UML Recap
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

Object-Oriented Modeling Chapter 10 CSCI 1302

CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships Among Classes –Association –Aggregation and Composition –Inheritance Class Design Guidelines –Designing a Class –Using the Visibility Modifiers

CSCI 1302 – Object-Oriented Modeling3 Outline Class Design Guidelines (cont.) –Using the static Modifier –Using Inheritance or Composition –Using Interfaces or Abstract Classes Framework-Based Programming Using the Java API

CSCI 1302 – Object-Oriented Modeling4 Software Development Process Software products follow a general process

CSCI 1302 – Object-Oriented Modeling5 Requirements Specification A formal process that seeks to understand the problem and document in detail what the system should do Close interaction between users and designers Real world projects are not as clearly defined or as simple as examples in class or book

CSCI 1302 – Object-Oriented Modeling6 System analysis Analyze the business process in terms of data flow Identify input and output Model the system’s behavior

CSCI 1302 – Object-Oriented Modeling7 System design Process of designing the system’s components Many levels of abstraction to decompose the problem into manageable components Identify classes and interfaces and establish relationships among them

CSCI 1302 – Object-Oriented Modeling8 Implementation Translate the design into programs Separate programs are written for each component Involves coding, testing, and debugging

CSCI 1302 – Object-Oriented Modeling9 Testing Ensures that the code meets the requirements specification and weeds out bugs Independent testers are usually used to conduct testing

CSCI 1302 – Object-Oriented Modeling10 Deployment Makes the project available for use Applets – Install on a web server Application – Installing on client’s computer Projects consist of many classes, java often packages all of them into a Java archive file (.jar file)

CSCI 1302 – Object-Oriented Modeling11 Maintenance Changing and improving the product Periodic upgrades Bug fixing Incorporate any changes

CSCI 1302 – Object-Oriented Modeling12 Discovering Relationships Three types of class relationships –Association –Aggregation –Inheritance

CSCI 1302 – Object-Oriented Modeling13 Association General binary relationship that describes an activity between two classes

CSCI 1302 – Object-Oriented Modeling14 Association Illustrated using a solid line with optional label (“Take” and “Teach”) Optional triangle to indicate direction of relationship Each class may have a role name (“Teacher”) Each class may specify multiplicity * - unlimited, m..n is an inclusive range Usually represented as a data field

CSCI 1302 – Object-Oriented Modeling15 Aggregation and Composition Aggregation is a special form of association that represents an ownership relationship between two classes Models “has-a” relationships Object may be owned by other aggregated objects, if exclusively owned, that is composition Empty diamond – aggregation, filled diamond – composition

CSCI 1302 – Object-Oriented Modeling16 Aggregation and Composition

CSCI 1302 – Object-Oriented Modeling17 Inheritance Models “is-a” relationship between two classes “Strong is-a” describes direct inheritance, extending a class “Weak is-a” describes a class that has certain properties, implementing an interface

CSCI 1302 – Object-Oriented Modeling18 Case Studies Model the application in terms of cooperative objects Building an object-oriented system 1.Identify classes for the system 2.Describe the attributes and methods in each class 3.Establish relationships among classes 4.Create classes

CSCI 1302 – Object-Oriented Modeling19 Designing a Class Class should describe a single entity, and all the class operations should fit together to support a coherent purpose Used by many different customers, should be able to customize through properties and methods Designed for reuse (see p. 358) Should provide a public no-arg constructor, override equals and toString

CSCI 1302 – Object-Oriented Modeling20 Using Visibility Modifiers Class can present two contracts: one for users, one for extenders Make fields private and accessor/mutator methods public if intended for users Make fields or methods protected if they are intended for extenders Use private to hide data from direct access by clients

CSCI 1302 – Object-Oriented Modeling21 Using the static Modifier A shared property among all instances of a class should be declared static Non-instance specific methods should be declared as a static method

CSCI 1302 – Object-Oriented Modeling22 Using Inheritance or Composition Inheritance – “is-a” relationship Apple is a Fruit public class Apple extends Fruit Composition – “has-a” relationship Person has a name public class Person { private Name name; }

CSCI 1302 – Object-Oriented Modeling23 Using Interfaces or Abstract Classes Both used to generalize common features “Strong is-a” relationship that clearly describes a parent-child relationship should be modeled using classes “Weak is-a” or “is-kind-of” relationship indicates an object has a certain property and should be modeled using interfaces

CSCI 1302 – Object-Oriented Modeling24 Framework-Based Programming Classes and interfaces provided by the Java API allow developers to harness the power of the framework GUI API established a framework for developing GUI programs Using these classes and interfaces to create applications is framework-based programming