Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.

Slides:



Advertisements
Similar presentations
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
Advertisements

UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
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,revised by Dai-kaiyu 1 Chapter 10 Object-Oriented Modeling.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
1 Introduction to CS Agenda Syllabus Schedule Lecture: the management of complexity.
1 Object-Oriented Design. 2 Objectives F To become familiar with the process of program development. F To the relationship types: association, aggregation,
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Object-Oriented Modeling Using UML CS 3331 Fall 2009.
Introduction To System Analysis and design
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented Design.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
COP3502 Programming Fundamentals for CIS Majors 1 Instructor: Parisa Rashidi.
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.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
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.
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.
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
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.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
PROG Object Oriented Programming II With Java PROG Object Oriented Programming II With Java Class Relationships.
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Domain Modeling Yonglei Tao.
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
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.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Coming up: Inheritance
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Object-Oriented Design.
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
 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.
Unified Modeling Language (UML)
Object-Oriented Modeling
Systems Analysis and Design With UML 2
Chapter 11 Object-Oriented Design
Chapter 10 Object-Oriented Modeling
Reference: COS240 Syllabus
Chapter 10 Thinking in Objects
Software Engineering Lecture #11.
UML Class Diagram.
Advanced Programming Behnam Hatami Fall 2017.
CS 112 Programming 2 Lecture 02 Abstract Classes & Interfaces (2)
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 Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines

Software Development Process The waterfall model

Software Development Process Requirements Specification 1. Requirements Specification: Understand the problem and document in details what it needs to do. This phase involves close interaction between users and designers. System Analysis 2. System Analysis: Analyze the business process in terms of data flow, and to identify the system’s input and output. Part of the analysis entails modeling the system behavior. The model is intended to capture the essential elements of the system and to define services to the system.

Software Development Process System Design 3. System Design: Design the system components. This phase involves the use of many levels of abstraction to decompose the problem into manageable components, identify classes and interfaces, and establish relationships among the classes and interfaces.

Software Development Process Implementation 4. Implementation: Translate the system design into programs. Separate programs are written for each component, and they are put to work together. This phase requires the use of an OOP language like Java. The implementation involves coding, testing and debugging.

Software Development Process Implementation 4. Implementation: Translate the system design into programs. Separate programs are written for each component, and they are put to work together. This phase requires the use of an OOP language like Java. The implementation involves coding, testing and debugging.

Software Development Process Testing 5. Testing: Ensure that the code meets the requirements specification and weeds out bugs. An independent team of software engineers not involved in design and implementation of the project usually conducts such testing. Deployment 6. Deployment: Make the project available for use. Maintenance 7. Maintenance: Change and improve the product. Periodically upgrade the product to fix newly discovered bugs and incorporate changes.

Relationships among Classes F OOP is centered on objects. F The first step: Identify the objects and establish relationships among them. F The relationships can be classified into three types: 1. Association: has-a relationship 2. Aggregation 3. Inheritance: is-a relationship

Association F Association represents a general binary relationship that describes an activity between two classes.  A student taking a course is an association between the Student class and the Course class.  A faculty member teaching a course is an association between the Faculty class and the Course class.

Association: UML F An association is is illustrated using a solid line between the two classes with an optional label that describes the relationship (see labels Take and Teach). F Each relationship may have an optional small black triangle that indicates the direction of the relationship. F Each class involved in the relationship may have a role name played by the class in the relationship.

Association: UML F Each class involved in the association may specify a multiplicity. A multiplicity could be a number or an interval that specifies how many objects of the class are involved in the relationship.  The caharacter * means unlimited number of objects, and an interval 1..u means the number of objects should be between 1 and u.

Association F Association may exist between objects of the same class. F For example, a person may have supervisor. Person Supervise 1 1

Association, cont. An association is usually represented as a data field in the class. public class Course { private Faculty faculty; /**Constructors*/ /**Methods*/ } public class Person { private Person supervisor; /**Constructors*/ /**Methods*/ }

Has-a relation F has-a F has-a, part-of, or owns. F Has-a relationship holds when one object has another object as component: object has a (stores) reference to another object. It may use another object to store its state or do its work.

Aggregation F Aggregation is a special form of association, which represents an ownership relationship between two classes. has-a F Aggregation models the relationship like has-a, part-of, owns, and employed-by. F An object may be owned by several other aggregated objects. An example of aggregation

Composition F Composition is a stronger form of aggregation. F In a composite object the components exists only as part of the composite. F Rules of thumb: 1) The whole and parts have coincident lifetimes. 2) Both classes represent physical items. F Examples: An engine is a part a car; a package is a part of a shipment; employee is a part of a team. Composition Aggregation

Composition: UML Notation

3. Inheritance is-a F Inheritance models the is-a relationship between two classes.  A strong is-a relation describes a direct inheritance relationship between two classes. Class Studen t inherits from the Person class. F A week is-a relation describes that a class has certain properties. A week is-a relationship can be represented using interfaces.

2. Inheritance public class Student extend Person { /**Constructors*/ /**Methods*/ } public class Faculty extend Person { /**Constructors*/ /**Methods*/ }

Is-a relation F Is-a relationship holds when class is a subtype of another class It may use another object to store its state or do its work. F All the properties: data and member functions unless overriden, are inherited from a base class. F Constructor for subclass will call the constructor for base class prior to any other actions. F Examples: Class Dog is inherited from a class Animal. Class Circle is inherited from abstract class Shape.

Major Inheritance Types 1. Inheritance for Extension 2. Inheritance for Specialization 3. Inheritance for Specification 4. Inheritance for Limitations 5. Inheritance for Construction 6. Inheritance for Combination

1. Inheritance for Extension F The subclass adds new functionality to the base class. F It does not change any inherited behavior F The first most common form of inheritance Example: Animal  (Dog, Cat)

2. Inheritance for Specialization F The subclass is a special case of the super class. F Specialized class redefines some of the methods of the superclass by overriden them. F Specialization is useful a class … with a more special behavior than superclass … that is a variation of the superclass …with more efficient implementation Example: MyApplet  Applet

3. Inheritance for Specification F The second most use of inheritance F The superclass defines behavior that is implemented in the subclass F All classes maintain a certain specification, which is a common interface (classes basically implements the same methods) Example: Delivery Company  (Air-Delivery Company, Ground-Delivery Company, Courier Company) Method deliver

4. Inheritance for Limitation The child class restricts the use of some of the behavior inherited from a parent class. Should be avoided Example:

5. Inheritance for Construction F A class can often inherit almost all of its functionality from a parent class, perhaps changing only the names of the methods used to interface to the class, or modifying the arguments. Example: The class Stack is constructed using inheritance from the class Vector. pop(), push()

6. Inheritance for Combination F It is common to form a new abstraction by combining features of two or more abstractions. F A new class extends an existing class and implements an interface. Example: A teaching assistant may have characteristics of both teacher and a student.

Class Development 1. Identify classes for the system. 2. Describe attributes and methods in each class. 3. Establish relationships among classes. 4. Create classes.

Example 9.1 Borrowing Mortgages Name BorrowerPersonMortgageAddress

Example 9.1 Borrowing Mortgages ( W/o getters and setters!)

Example: Account

UML: Classes

UML: The Rational Class

UML: Package

Class Design Guidelines F Hide private data and private methods. F A property that is shared by all the instances of the class should be declared as a class property.  Provide a public default constructor and override the equals() method and the toString() method defined in the Object class whenever possible.

Class Design Guidelines, cont. F Choose informative names and follow consistent styles. F A class should describe a single entity or a set of similar operations. F Group common data fields and operations shared by other classes.

Example 9.4 Designing Generic Classes F Objective: This example gives a generic class for matrix arithmetic. This class implements matrix addition and multiplication common for all types of matrices.

UML: Package