Single Responsibility Principle @ AgileCamp Feb, 27 2010

  • 1,147 views
Uploaded on

 

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,147
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. SRP Andrea Francia
  • 2.
    • What is SRP?
    • Why you should apply SRP?
    • Why you shouldn’t apply SRP?
  • 3. The Principle
    • Single Responsibility Principle:
    • “ A class should have only one reason to change”
    • from the PPP Book: “Agile Software Development Principle, Patterns, and Practice” by Robert C. Martin
  • 4. Problems without SRP
    • Problems:
      • Linking of gui.lib in CalcApp
      • If a change in GraphApp forces a change in Rectangle we may be force to rebuild, retest and redeploy CalcApp.
  • 5. Applying SRP
    • Is better? Depends
      • More Complex
      • Less Fragile … but in respect of what type of change?
  • 6. Violation example: use of wxWidgets instead of wxBase
  • 7. Violation example: bad use of wxWidgets
    • Solution: extract responsibiliy
  • 8. Too much SRP
  • 9. Bad use of JPA Entities
  • 10. Thanks
    • Andrea Francia
      • [email_address]
      • http:// www.andreafrancia.it /
      • http:// blog.andreafrancia.it /