ooad presentation

Click here to load reader

Post on 05-Dec-2014




7 download

Embed Size (px)




  • 1. Object-Oriented Analysis and Design
  • 2. How do you write great software every time?
  • 3. Great software?
  • 4. The software must do what the customer wants it to do
  • 5. Make your code smart Well-Designed Well-Coded Easy to mantain Easy to reuse Easy to extend
  • 6. Great software satisfies the customer and the programmer
  • 7. Programmers are satisfied when: Their apps can be REUSED Their apps are FLEXIBLE Customers are satisfied when: Their apps WORK Their apps KEEP WORKING Their apps can be UPGRADED
  • 8. Ok but what shall the software do?
  • 9. Gathering requirements Pay attention to what the system needs to You can figure out how later
  • 10. Requirement? Its a specific thing Your system has to do to work correctly Usually a single thing, and you can test that thing to make sure you fullfilled the requirement The complete app or project you are working on 2 - so if you leave out a requirement or even if they forget to mention sth your system isnt working correctly 1 - The customer decides when a system works correctly,
  • 11. Your software has a context
  • 12. Develope rs viewpoint (the perfect world) Real world
  • 13. + Analysis = Real world context Textual analysis = nouns / verbsUse cases Diagrams
  • 14. Nothing ever stay the same No matter how much you like your Right now, its probably going to ch Tomorrow Good design = flexible and resilien
  • 15. Design principles Techniques that can be applied for designing or writing code to make that code more Mantainable, flexible or extensible OCP Open-closed princople DRY Dont repeat yourself SRP Single responsibility principle Classes are open for extension And closed for modification Avoid duplicate code by abstracting Things that are common Every object in your project should have a single responsabil
  • 16. Open-closed principle class Printer{ public final void print(Printable p){ } } class SquarePrinter extends Printer{ public void print(Square s){ } } OPEN = Extending functionality ClOSED = NO OVERRIDES
  • 17. Single responsibility principle public class MobileCaller{ public void callMobile(MobileNo mobileNo){ ... } } public class ValidationService{ public static boolean validateMobileNumber(MobileNo mobileNo){ ... } } Responsibility #1: Call Responsibility #2: validate number
  • 18. DRY Dont repeat yourself
  • 19. By Contract / Defensive programming programming defensively means youre making sure the client gets safe response, no matter what the client wants to have happen Programming by contract means you are working with a client code to agree on how youll handle problem situations
  • 20. Defensive programming