DESIGN PATTERNS COUPLING AND COHESION WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO.

Slides:



Advertisements
Similar presentations
Software Engineering Key design concepts Design heuristics Design practices.
Advertisements

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.
Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part II)
High Quality Code Why it matters. By Ryan Ruzich.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
PATTERNS -STRUCTURAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 5 Architecture-Driven Component Development.
Detailed Design Kenneth M. Anderson Lecture 21
Copyright W. Howden1 Lecture 6: Design Evaluation and Intro to OO Design Patterns.
XP2007b Extreme Code Quality Dongsu Park Venkatesh BS.
Low Coupling High Cohesion
PVK-Ht051 Contents Introduction Requirements Engineering Project Management Software Design Detailed Design and Coding Quality Assurance Maintenance.
Week 3 Recap CSE 115 – Spring Constructor Special capability of a class that sets up the initial state of the object. Constructor definitions are.
Inheritance Review/Recap. ClassA extends ClassB ClassA now inherits (can access and use) all public and protected elements of ClassB We can expect the.
Design Patterns and Responsibility Assignment CMPT 371 Fall 2004 J.W. Benham.
System Architecture: Desing alternatives and methodologies.
UML and Object Oriented Concepts
Pattern Abstract Factory
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
MVC and MVP. References enter.html enter.html
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
COMP 354 Software Engineering I Section BB Summer 2009 Dr Greg Butler
1 On to Object Design Chapter 14 Applying UML and Patterns.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Week 3-4 MondayTuesdayWednesdayThursdayFriday Design Reading II due Group meetings SRS due DesignUMLDesign Progress report due Lecture TBA Reading III.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Software Design Deriving a solution which satisfies software requirements.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
Relational Databases and Transaction Design Lecture 27.
Concepts of Software Quality Yonglei Tao 1. Software Quality Attributes  Reliability  correctness, completeness, consistency, robustness  Testability.
Criteria Based Software Product Integration Architecture F. Tsui Southern Polytechnic State University.
Chapter 7 Software Engineering Introduction to CS 1 st Semester, 2015 Sanghyun Park.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
Core Indigo Patterns Ted Neward
CSE 403, Spring 2008, Alverson Software Design “There are two ways of constructing a software design: one way is to make it so simple that there are obviously.
Criteria Based Software Product Integration Architecture (2007) F. Tsui Kennesaw State University (Southern Polytechnic State University)
Introduction to Design. What is Design? 2 minutes Pairs.
DESIGN PATTERNS -BEHAVIORAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
CHAPTER 2 DATABASE CONNECTION(MYSQ L) Wattanapong suttapak, Software Engineering, school of Information communication Technology, university of phayao.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Jump to first page (C) 1998, Arun Lakhotia 1 Design Quality Metrics Arun Lakhotia University of Southwestern Louisiana Po Box Lafayette, LA 70504,
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
DESIGN PATTERNS -CREATIONAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
Design and Planning Or: What’s the next thing we should do for our project?
Evaluating an Object-Oriented Design ©SoftMoore ConsultingSlide 1.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Deriving Abstract Factory Loosening the coupling when creating objects...
Basic Characteristics of Object-Oriented Systems
Beginning Software Craftsmanship Brendan Enrick Steve Smith
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
Coupling and Cohesion Rajni Bhalla.
Conception OBJET GRASP Patterns
Best Practices for Software System Design
TK2023 Object-Oriented Software Engineering
Coupling and Cohesion By Bonnie Ngu.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Improving the Design “Can the design be better?”
Software Engineering Lecture #8.
Software Engineering Lecture #45
Bivariate Association: Introduction & Basic Concepts
Which best describes the relationship between classes and objects?
Design Module view What module should the system and which have to be developed . It determines the module structure of components.
Coupling Interaction: It occurs due to methods of a class invoking methods of other classes. Component Coupling: refers to interaction between two classes.
Presentation transcript:

DESIGN PATTERNS COUPLING AND COHESION WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1

จุดประสงค์การเรียนรู้  เข้าใจความหมายของ coupling และ cohesion  เข้าใจถึงระดับความสัมพันธ์ของ coupling และ cohesion  เข้าใจความสัมพันธ์ระหว่าง coupling และ cohesion 2

MEANING Coupling and cohesion are used in analyzing the software design Coupling is degree of interdependence between objects(or classes) Cohesion is measurement of the strength of functional relatedness of elements within a objects Type of coupling and cohesion 3 couplingcohesion loose(low)low tight(high)high

COUPLING Tight-Coupling: 1. While creating complex application in java, the logic of one class will call the logic of another class to provide same service to the clients. 2. If class(A) calling class(B) logic then it is called collaboration. 3. When class(A) is collaborating with class(B) then there exists tight-coupling between two classes. 4. If class(A) call the logic of class(B) then class(A) need an object of class(B). It means class(A) create an instance of class(B). 5. For example, there are two classes,traveler and car. Traveler class is calling logic of car class; In this case traveler class creates an object of car class. 6. Instance of car class object depend on(dependency) traveler object. 4

TIGHT-COUPLING: 5

6

LOOSE-COUPLING: 7

COHESION: Steve McConnell 8 support a central purpose. Classes that contain strongly related functionality are described as having strong cohesion, and the heuristic goal is to make cohesion as strong as possible. Cohesion is a useful tool for managing complexity because the more code in a class supports a central purpose, the more easily your brain can remember everything the code does. Uncle Bob's Clean Code(cleancoders.com) Classes should have a small number of instance variables. Each of the methods of a class should manipulate one or more of those variables. In general the more variables a method manipulates the more cohesive that method is to its class. A class in which each variable is used by each method is maximally cohesive. In general it is neither advisable nor possible to create such maximally cohesive classes; on the other hand, we would like cohesion to be high. When cohesion is high, it means that the methods and variables of the class are co-dependent and hang together as a logical whole.

COHESION: 9 low-cohesion high-cohesion

COUPLING AND COHESION 10 Good design software need  loose-coupling and high-cohesion (flexible system)  loosely couple is decouple