SlideShare uma empresa Scribd logo
1 de 22
BY :
Afaq Ahmed
1
1. Low Coupling
2. Controller
3. High Cohesion
2
Presentation Topics
CouplingCoupling
Coupling is a measure of how strongly one
element is connected to other, has
knowledge of, or relies upon other elements
3
Low Coupling:Low Coupling:
An element with Low Coupling is not
dependent upon too many other
elements.These Elements include
classes,systems,subsystems and so on.
High Coupling:
A class with high Coupling relies on many
other classes.
4
Problems with high coupling:
◦ Forced local changes because of changes in
related classes
◦ Harder to understand in isolation
◦ Harder to reuse because it requires other
classes
Solution:
Assign responsibility so coupling remains low
5
NextGen exampleNextGen example
 If we need to create a Payment instance and associate it
with Sale, who should do it? Since Register records a
payment, the Creator pattern suggests register as a
candidate for creating the payment.
 Register instance then pass message to sale with
parameter payment.
6
7
Alternative solutionAlternative solution
In both cases Sales must be coupled eventually with
payment. In Design 1 Register creates the payment,
adds coupling of register with the payment. In design
2 sales creates the payment which does not increase
the coupling. Design 2 is preferable because the
coupling is low in design 2 than design 1.
ControllerController
A controller is the first object beyond
the user interface that is responsible for
receiving or handling a system operation
message.
8
ControllerController
Assign responsibility to a class with one
of the following:
◦ Represents the overall “system,” a “root
object,” a device the software is running
within, or a major subsystem (façade
controller)
◦ Represents a use case scenario within which
the system event occurs, often called
<UseCaseName>Handler
9
ControllerController
The UI layer gets data and an “Enter Item”
message (or some other message, in the case
of the assignment)
CS6359 Fall 2011 John Cole 10
ControllerController
You may want to use the same controller
class for all system events of one use case
so it can maintain state.
Possible problem of over-assignment of
responsibility
It should delegate the work to other
objects, not do it
11
Façade ControllerFaçade Controller
Suitable when there are not too many
system events
This could be an abstraction of the
overall physical unit, such as
PhoneSwitch, CashRegister, etc.
12
Use Case ControllerUse Case Controller
This Kind of controller is not a domain
object. It is an artificial construct to
support the system.For example if our
next generation application contains
usecases Process sales and Payment then
there may be a processalehandling class.
When using a façade controller leads to
low cohesion and high coupling
When the façade controller gets blotted
then usecase controller is a good choice
13
Bloated ControllerBloated Controller
Poorly designed, a controller class which
have low cohesion, unfocused and
handling to many areas of responsibility it
is called blotted controller.
14
Issues :Issues :
If there is a single controller class
receiving all system events in the system.
This sometimes happen if a façade
controller is chosen.
A controller it self performs many tasks
necessary to fulfill the system events. This
usually involves the violation of
information expert and High cohesion.
CS6359 Fall 2011 John Cole 15
Solutions:Solutions:
Add more controllers to a system does
not need to have only one.Consider an
application with many events such as
airline reservation system which might
have these controllers
16
Design the controller so that it primarilly
the fullfillment of each system operations
and responsibilities of other objects.
CS6359 Fall 2011 John Cole 17
High CohesionHigh Cohesion
Cohesion is a measure of how strongly
related and focused the responsibilities of
an element are
18
Problems with Low CohesionProblems with Low Cohesion
A class with low cohesion does many
unrelated things.
It is hard to understand,.
hard to reuse.
hard to maintain.
Constantly affected by Change
19
20
The responsibility of making a payment is assigned to the Register.
But if we making class register to do more work and other system
Operations it will become burdened.
Suppose 50 operations received to the register and it become blotted
Object.
In this design register is just initializing
one operation makepayment and passing
messege to the sale class for further
operations.
This design is suitable because it have
high cohesion and low coupling.
21
22

Mais conteúdo relacionado

Semelhante a 17 slide grasp

208-dataflowdgm.ppt
208-dataflowdgm.ppt208-dataflowdgm.ppt
208-dataflowdgm.pptRAJA RAY
 
data flow diagram power point presentation
data flow diagram power point presentationdata flow diagram power point presentation
data flow diagram power point presentationSUBHASHREEBASU5
 
Software engg. pressman_ch-8
Software engg. pressman_ch-8Software engg. pressman_ch-8
Software engg. pressman_ch-8Dhairya Joshi
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxminaltmv
 
Lecture10 use case model operation contracts
Lecture10 use case model operation contractsLecture10 use case model operation contracts
Lecture10 use case model operation contractsShahid Riaz
 
208 dataflowdgm
208 dataflowdgm208 dataflowdgm
208 dataflowdgmTCT
 
Design Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John HardyDesign Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John HardyManageIQ
 
04 transaction models
04 transaction models04 transaction models
04 transaction modelsashish61_scs
 
Ph.D. final defense
Ph.D. final defensePh.D. final defense
Ph.D. final defensemaxdeleoni
 
SE - Lecture 13 - Software Evolution and Tech Trends.pptx
SE - Lecture 13 - Software Evolution and Tech Trends.pptxSE - Lecture 13 - Software Evolution and Tech Trends.pptx
SE - Lecture 13 - Software Evolution and Tech Trends.pptxTangZhiSiang
 
Administrator Privileges: Finding Balance between desktop security & user pro...
Administrator Privileges: Finding Balance between desktop security & user pro...Administrator Privileges: Finding Balance between desktop security & user pro...
Administrator Privileges: Finding Balance between desktop security & user pro...ScriptLogic
 
SE_Lec 08_UML Use Cases
SE_Lec 08_UML Use CasesSE_Lec 08_UML Use Cases
SE_Lec 08_UML Use CasesAmr E. Mohamed
 
Automatic Resource Elasticity for HPC Applications
Automatic Resource Elasticity for HPC ApplicationsAutomatic Resource Elasticity for HPC Applications
Automatic Resource Elasticity for HPC Applicationsrrrighi
 
The Power Of Event Chapter 1
The Power Of Event Chapter 1The Power Of Event Chapter 1
The Power Of Event Chapter 1Woojin Joe
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryZainab Almugbel
 
Techno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency TradersTechno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency TradersCloudCheckr
 

Semelhante a 17 slide grasp (20)

208-dataflowdgm.ppt
208-dataflowdgm.ppt208-dataflowdgm.ppt
208-dataflowdgm.ppt
 
data flow diagram power point presentation
data flow diagram power point presentationdata flow diagram power point presentation
data flow diagram power point presentation
 
Software engg. pressman_ch-8
Software engg. pressman_ch-8Software engg. pressman_ch-8
Software engg. pressman_ch-8
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docx
 
Mvc grasp
Mvc graspMvc grasp
Mvc grasp
 
Lecture10 use case model operation contracts
Lecture10 use case model operation contractsLecture10 use case model operation contracts
Lecture10 use case model operation contracts
 
Data flow
Data flowData flow
Data flow
 
How to Data Flow Diagram
How to Data Flow Diagram How to Data Flow Diagram
How to Data Flow Diagram
 
208 dataflowdgm
208 dataflowdgm208 dataflowdgm
208 dataflowdgm
 
Design Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John HardyDesign Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John Hardy
 
04 transaction models
04 transaction models04 transaction models
04 transaction models
 
Ph.D. final defense
Ph.D. final defensePh.D. final defense
Ph.D. final defense
 
SE - Lecture 13 - Software Evolution and Tech Trends.pptx
SE - Lecture 13 - Software Evolution and Tech Trends.pptxSE - Lecture 13 - Software Evolution and Tech Trends.pptx
SE - Lecture 13 - Software Evolution and Tech Trends.pptx
 
Administrator Privileges: Finding Balance between desktop security & user pro...
Administrator Privileges: Finding Balance between desktop security & user pro...Administrator Privileges: Finding Balance between desktop security & user pro...
Administrator Privileges: Finding Balance between desktop security & user pro...
 
SE_Lec 08_UML Use Cases
SE_Lec 08_UML Use CasesSE_Lec 08_UML Use Cases
SE_Lec 08_UML Use Cases
 
Automatic Resource Elasticity for HPC Applications
Automatic Resource Elasticity for HPC ApplicationsAutomatic Resource Elasticity for HPC Applications
Automatic Resource Elasticity for HPC Applications
 
The Power Of Event Chapter 1
The Power Of Event Chapter 1The Power Of Event Chapter 1
The Power Of Event Chapter 1
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theory
 
Techno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency TradersTechno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency Traders
 
Framing the Problem
Framing the ProblemFraming the Problem
Framing the Problem
 

Último

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Último (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

17 slide grasp

  • 2. 1. Low Coupling 2. Controller 3. High Cohesion 2 Presentation Topics
  • 3. CouplingCoupling Coupling is a measure of how strongly one element is connected to other, has knowledge of, or relies upon other elements 3
  • 4. Low Coupling:Low Coupling: An element with Low Coupling is not dependent upon too many other elements.These Elements include classes,systems,subsystems and so on. High Coupling: A class with high Coupling relies on many other classes. 4
  • 5. Problems with high coupling: ◦ Forced local changes because of changes in related classes ◦ Harder to understand in isolation ◦ Harder to reuse because it requires other classes Solution: Assign responsibility so coupling remains low 5
  • 6. NextGen exampleNextGen example  If we need to create a Payment instance and associate it with Sale, who should do it? Since Register records a payment, the Creator pattern suggests register as a candidate for creating the payment.  Register instance then pass message to sale with parameter payment. 6
  • 7. 7 Alternative solutionAlternative solution In both cases Sales must be coupled eventually with payment. In Design 1 Register creates the payment, adds coupling of register with the payment. In design 2 sales creates the payment which does not increase the coupling. Design 2 is preferable because the coupling is low in design 2 than design 1.
  • 8. ControllerController A controller is the first object beyond the user interface that is responsible for receiving or handling a system operation message. 8
  • 9. ControllerController Assign responsibility to a class with one of the following: ◦ Represents the overall “system,” a “root object,” a device the software is running within, or a major subsystem (façade controller) ◦ Represents a use case scenario within which the system event occurs, often called <UseCaseName>Handler 9
  • 10. ControllerController The UI layer gets data and an “Enter Item” message (or some other message, in the case of the assignment) CS6359 Fall 2011 John Cole 10
  • 11. ControllerController You may want to use the same controller class for all system events of one use case so it can maintain state. Possible problem of over-assignment of responsibility It should delegate the work to other objects, not do it 11
  • 12. Façade ControllerFaçade Controller Suitable when there are not too many system events This could be an abstraction of the overall physical unit, such as PhoneSwitch, CashRegister, etc. 12
  • 13. Use Case ControllerUse Case Controller This Kind of controller is not a domain object. It is an artificial construct to support the system.For example if our next generation application contains usecases Process sales and Payment then there may be a processalehandling class. When using a façade controller leads to low cohesion and high coupling When the façade controller gets blotted then usecase controller is a good choice 13
  • 14. Bloated ControllerBloated Controller Poorly designed, a controller class which have low cohesion, unfocused and handling to many areas of responsibility it is called blotted controller. 14
  • 15. Issues :Issues : If there is a single controller class receiving all system events in the system. This sometimes happen if a façade controller is chosen. A controller it self performs many tasks necessary to fulfill the system events. This usually involves the violation of information expert and High cohesion. CS6359 Fall 2011 John Cole 15
  • 16. Solutions:Solutions: Add more controllers to a system does not need to have only one.Consider an application with many events such as airline reservation system which might have these controllers 16
  • 17. Design the controller so that it primarilly the fullfillment of each system operations and responsibilities of other objects. CS6359 Fall 2011 John Cole 17
  • 18. High CohesionHigh Cohesion Cohesion is a measure of how strongly related and focused the responsibilities of an element are 18
  • 19. Problems with Low CohesionProblems with Low Cohesion A class with low cohesion does many unrelated things. It is hard to understand,. hard to reuse. hard to maintain. Constantly affected by Change 19
  • 20. 20 The responsibility of making a payment is assigned to the Register. But if we making class register to do more work and other system Operations it will become burdened. Suppose 50 operations received to the register and it become blotted Object.
  • 21. In this design register is just initializing one operation makepayment and passing messege to the sale class for further operations. This design is suitable because it have high cohesion and low coupling. 21
  • 22. 22