Coupling Cohesion Chandan R. Rupakheti Steve Chenoweth (Chapter 18)

Slides:



Advertisements
Similar presentations
User Defined Functions
Advertisements

Quality of a Class Abstraction: Coupling & Cohesion Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
Communication between modules, cohesion and coupling
1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part II)
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
What is Software Design?  Introduction  Software design consists of two components, modular design and packaging.  Modular design is the decomposition.
Copyright Irwin/McGraw-Hill Software Design Prepared by Kevin C. Dittman for Systems Analysis & Design Methods 4ed by J. L. Whitten & L. D. Bentley.
© Copyright 2011 John Wiley & Sons, Inc.
Module: Definition ● A logical collection of related program entities ● Not necessarily a physical concept, e.g., file, function, class, package ● Often.
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part I)
Linux+ Guide to Linux Certification, Second Edition
Jump to first page 1 System Design (Finalizing Design Specifications) Chapter 3d.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design Copyright 2000 © John Wiley & Sons, Inc. All rights reserved. Slide 1 Key.
Criteria for good design. aim to appreciate the proper and improper uses of inheritance and appreciate the concepts of coupling and cohesion.
Systems Analysis and Design
CSSE 374: More GRASP’ing and Use Case Realization Steve Chenoweth Office: Moench Room F220 Phone: (812) These.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
Coupling and Cohesion Source:
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Program Design Simple Program Design Third Edition A Step-by-Step Approach 9.
Software Design Designing the overall structure (architecture) of a software system Designing small pieces of computation Designing non-automated processes.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
1 Software Design Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13, 5 th edition and Ch. 10, 6 th edition.
SOFTWARE DESIGN Design Concepts Design is a meaningful engineering representation of something that is to be built It can be traced to a customer’s requirements.
Week 3-4 MondayTuesdayWednesdayThursdayFriday Design Reading II due Group meetings SRS due DesignUMLDesign Progress report due Lecture TBA Reading III.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
Concepts of Software Quality Yonglei Tao 1. Software Quality Attributes  Reliability  correctness, completeness, consistency, robustness  Testability.
Cohesion and Coupling CS 4311
Coupling & Cohesion CMSC 201- Fall '11. Vocabulary Routine- A programming unit that performs a task, such as a function, procedure, method, or main class.
Programming Logic and Design Using Methods. 2 Objectives Review how to use a simple method with local variables and constants Create a method that requires.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
CCSB223/SAD/CHAPTER131 Chapter 13 Designing the System Internals.
Structured design - 1 © Minder Chen, Produce Paycheck Retrieve Employee Record Global Data Store Offpage Calling Module Called Module System.
Jump to first page (C) 1998, Arun Lakhotia 1 Design Quality Metrics Arun Lakhotia University of Southwestern Louisiana Po Box Lafayette, LA 70504,
Exam 2 Review Software Engineering CS 561. Outline Requirements Development UML Class Diagrams Design Patterns Users, Usability, and User Interfaces Software.
Applying Use Cases to Implementation (Chapters 25,26 - Requirements Text) Steve Chenoweth & Chandan Rupakheti Question 1.
Object-Oriented Design. 1 Objects and concerns Objects have a concern, meaning they have a purpose Not concerned as in worried All code should have a.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Key Principles of Software Architecture and Design (II) adapted from Dave Penny’s.
Week 6: Software Design HNDIT Software Engineering Software Design Learning Outcomes  Understand the activities involved in the Design process.
Systems Development Lifecycle
Slide 1 Good Methods. Slide 2 Cohesion and Coupling l For structured design These software metrics were used extensively Proven to be effective l For.
Lecture 12 Implementation Issues with Polymorphism.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Programming Logic and Design Fifth Edition, Comprehensive Chapter 7 Using Methods.
SOFTWARE DESIGN & SOFTWARE ENGINEERING Software design is a process in which data, program structure, interface and their details are represented by well.
Coupling and Cohesion Schach, S, R. Object-Oriented and Classical Software Engineering. McGraw-Hill, 2002.
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
1 Week 7 Software Engineering Spring Term 2016 Marymount University School of Business Administration Professor Suydam.
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
7. Modular and structured design
Coupling and Cohesion Rajni Bhalla.
Software Testing Techniques
Coupling and Cohesion 1.
Design Characteristics and Metrics
Software Design Mr. Manoj Kumar Kar.
Cohesion and Coupling Chapter 5, Pfleeger 01/01/10.
Software Design Designing the overall structure (architecture) of a software system Designing small pieces of computation Designing non-automated processes.
User Defined Functions
Improving the Design “Can the design be better?”
Software Design CMSC 345, Version 1/11.
Programming Logic and Design Fourth Edition, Comprehensive
Software Design Lecture : 9.
Software Design Lecture : 10
Communication between modules, cohesion and coupling
Design Module view What module should the system and which have to be developed . It determines the module structure of components.
Cohesion and Coupling.
Chapter 8: Design: Characteristics and Metrics
Presentation transcript:

Coupling Cohesion Chandan R. Rupakheti Steve Chenoweth (Chapter 18)

Outline Coupling and Cohesion Command and Query Separation Principle 2

Types of Coupling Tight to loose coupling Content: Module A has access to local data of Module B Common: Global variable shared between two modules External: Share an externally imposed data format or communication protocol Control: Module A controls the control flow of module B through flags Stamp: Modules share a composite data structure but uses only a part of it Data: Modules share data through parameters Message: Modules communicate via message passing (e.g. Observer) No Coupling: Modules do not communicate at all 3

Types of Cohesion Worst to best cohesion Coincidental: When parts of a module is grouped arbitrarily, e.g. Utilities class Logical: Grouped because they are logically categorized to do the same thing, e.g. MouseListener Temporal: Grouped at runtime, e.g. exception processing function that does multiple task, e.g. close file, log error, and notify users Procedural: Grouped because they follow a certain sequence of execution, e.g. function which checks file permission and opens it Communicational: Grouped because they operate on the same data Sequential: Grouped because the output from one part is the input to another part Functional: Grouped because they all contribute to a single well- defined task of the module 4

Command-Query Separation Principle Each method should be either a command or a query Command Method Performs an action, typically with side effects, but has no return value Query Method Returns data but has no side effects Why is this principle important? Principle of least surprise, side effects only happen in “void” methods Provides for most flexible interface, e.g. a value can be queried multiple times without changing it 5

Things to Do Next Look at the quiz for today, and the zipped program. Answer the related questions about coupling! Answer the last question about cohesion! Turn in after class, as usual, but please also be ready to discuss your answers in class! 6