THE OBJECT-ORIENTED DESIGN WORKFLOW Interfaces & Subsystems.

Slides:



Advertisements
Similar presentations
MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Advertisements

Software Engineering 2003 Jyrki Nummenmaa 1 OBJECT ARCHITECTURE DESIGN These slides continue with our example application, based on the simplified.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
CSCI 639 Topics in Software Engineering Assignment #3 Fall 2008.
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
1 CS 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Object Oriented Analysis and Design Using the UML
Object-Oriented Analysis and Design
Relationships. In the Interaction diagrams, we began to look at how classes communicate with one another. Now, we'll focus on the relationships between.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
UNIT-V The MVC architecture and Struts Framework.
What is Software Architecture?
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
The Design Discipline.
Why Analysis Process Refer to earlier chapters Models what the system will do makes it easier for understanding no environment considered (hence, system.
© Drexel University Software Engineering Research Group (SERG) 1 Based on the paper by Philippe Kruchten from Rational Software.
Systems Analysis and Design in a Changing World, Fifth Edition
Systems Analysis and Design in a Changing World, Fifth Edition
Introduction to Object-oriented programming and software development Lecture 1.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
Design Dan Fleck CS 421 George Mason University. What is the design phase? Analysis phase describes what the system should do Analysis has provided a.
An Introduction to Software Architecture
Systems Analysis and Design in a Changing World, 6th Edition
12 Systems Analysis and Design in a Changing World, Fifth Edition.
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.
Detailed design – class design Domain Modeling SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Software Design Deriving a solution which satisfies software requirements.
Systems Analysis and Design in a Changing World, 3rd Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 4: Restaurant.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
GRASP: Designing Objects with Responsibilities
2 Object-Oriented Analysis and Design and the Unified Process Objectives  Explain the purpose and objectives of object- oriented design  Develop design.
1 Advanced Software Architecture Muhammad Bilal Bashir PhD Scholar (Computer Science) Mohammad Ali Jinnah 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.
OOAD Unit – I OBJECT-ORIENTED ANALYSIS AND DESIGN With applications
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Part VII: Design Continuous
Relationships Relationships between objects and between classes.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Design CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2008 Course.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Lecture 14 22/10/15. The Object-Oriented Analysis and Design  Process of progressively developing representation of a system component (or object) through.
Analysis Yaodong Bi. Introduction to Analysis Purposes of Analysis – Resolve issues related to interference, concurrency, and conflicts among use cases.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 15. Review Interaction-Oriented Software Architectures – MVC.
Basic Characteristics of Object-Oriented Systems
11. Chapter 11: The Object-Oriented Approach to Design: Use Case Realization Systems Analysis and Design in a Changing World, Fourth Edition.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
1 M206 Chapter 31: An Overview of Software Development 1.Defining the problem 2.Analyzing the requirement – constructing initial structural model 3.Analyzing.
Design Concepts ch-8
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
The Object-Oriented Thought Process Chapter 08
The Object Oriented Approach to Design
Chapter 19: Interfaces and Components
An Introduction to Software Architecture
Chapter 19: Interfaces and Components
Chapter 19: Interfaces and Components
Interfaces and Components
Chapter 19: Interfaces and Components
Presentation transcript:

THE OBJECT-ORIENTED DESIGN WORKFLOW Interfaces & Subsystems

Design Workflow Responsibilities

Interfaces l An interface specifies a named set of operations. l The key idea behind interfaces is to separate the specification of functionality (the interface) from its implementation by a classifier such as a class or subsystem. The interface defines the contract that is implemented by the classifier. l Interfaces become architecturally very important in design, as they provide the “plugs and sockets” that allow you to connect your design subsystem together without connecting specific classes in those subsystems.

Interfaces (contd) l Each operation in an interface must have: –the complete operation signature (name, types of all parameters, and return type); –the semantics of the operation - this can be recorded as text or pseudocode; –optionally, a stereotype, and sets of constraints and tagged values. l Interfaces may not have: –attributes; –operation implementation; –relationships navigable from the interface to anything else. –never specifies any kind of implementation l Once the interface is defined, then everything else in the system that needs the interface service will simply realize this interface

Interfaces – Notations 1

Interfaces – Notations 2

Interfaces – Key to Component-based Development (CBD) l CBD is about constructing software from plug-in parts. l You must design interfaces if you want “plug-and- play” software components where you can plug new implementations at will. l Interfaces allow you to connect things together without introducing coupling to specific classes

Interfaces Example - Printer l The Printer class knows how to print anything that implements the Print interface. l This interface defines a single abstract polymorphic method called print(g:Graphics) l This method must be implemented by all classes that implement Print. Notice that the Printer class is completely decoupled and independent of the actual classes that implement Print Customer Order Printer Print >

Interfaces Between Subsystems l You can use interfaces very effectively with subsystems l GUI subsystem only knows about the CustomerManager and AccountManager interfaces – not anything about the workings of the subsystem GUI Business Logic CustomerManagerAccountManager >

Finding Interfaces l When you have designed a system or part of a system, it is worth examining the model to try and find some interfaces. l Do the following: –Challenge each association - look at each one and ask the question, “Should this association really be a particular class of objects, or should it be more flexible that this?” If you decide that the association really needs to be more flexible than it would be if it were tied to a particular class, then consider using an interface. –Challenge each message send - look at each one and ask the question, “Should this message send really be to objects of just one class, or should it be more flexible than this?” If it should be more general (i.e. if you can think of cases where the same message could be sent to objects of other classes) then consider using an interface. –Factor out groups of operations that might be reusable in more than one class. –Look for classes that play the same role in the system - the role may indicate a possible interface. –Look for possibilities for future expansion. Sometimes, with just a little forethought, you can design systems that can be expanded easily in the future. The key question is, “In the future, will other classes need to be added to the system?” If the answer is yes, try to define one or more interfaces that will define the protocol for adding these new classes.

Interfaces - Advantages l When you design with classes, you are constraining the design to specific implementations. But when you design with interfaces, you are instead designing to contracts that may be realized by many different implementations. Designing to contracts frees the model (and ultimately the system) from implementation dependencies and therefore increases its flexibility and extensibility. l Designing with interfaces allows you to reduce the number of dependencies between classes, subsystems, and components and hence begins to give control over the amount of coupling in a model. In a real sense, coupling is the worst enemy of the object developer, as highly coupled systems are hard to understand, maintain, and evolve. Appropriate use of interfaces can help to reduce coupling and to separate the model into cohesive subsystems.

Interfaces - Disadvantages l There are drawbacks in using interfaces. –Generally speaking, whenever you make something more flexible you make it more complex. When you design with interfaces, you are looking for a trade-off between flexibility and complexity. –There is often a performance cost to flexibility, but this is usually a minor consideration compared to the increase in complexity. l When you design a system you are trying to capture a very definite set of business semantics in software. Some of these semantics are fluid and change quite rapidly, while others are relatively stable. –You need flexibility to help deal with the fluid aspects, but can simplify systems by dispensing with a certain amount of flexibility for the more stable parts. – In a way, this is one of the secrets of good OOAD - identifying the fluid and stable parts of a system and modeling each accordingly.

Interfaces Conclusion l A very powerful use of interfaces is to provide the ability to plug things in to systems. l One of the ways to make systems flexible and resilient to change is to design the system such that extensions can be plugged in easily. l Interfaces are the key to this. l If you can design systems around interfaces, then associations and message sends are not longer tied to objects of a particular class but instead are tied to a specific interface. This makes it much easier to add new classes to a system, as the interfaces define the protocols that the new classes must support in order to plug in seamlessly.

Subsystems l What are subsystems? –A subsystem is a package stereotyped >. You use subsystems in both design and implementation. These are known as design subsystems and implementation subsystems. l Design subsystems contain: –design classes and interfaces; –use case realizations; –other subsystems; –specification elements such as use cases. l Subsystems are used to: –separate design concepts; –represent large-grained components; –wrap legacy systems l Design subsystems are how you begin to “componentize” your model. You break the analysis packages into one or more design subsystems and also introduce new design subsystems that only contain artifacts from the solution domain, such as database access classes or communications classes.

Subsystem Example - Layers Database > Customer > Product > Order > GUI > Presentation Business Logic Data Access/Utility