Successfully reported this slideshow.

Polymorphism ruby

2

Share

Loading in …3
×
1 of 23
1 of 23

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

Polymorphism ruby

  1. 1. Replacing Conditionals With Polymorphism @gpespn
  2. 2. “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” -- Martin Fowler @gpespn
  3. 3. @gpespn But why? • Easier to read • Maintainability • Extensibility • Isolation of change • Easier to test
  4. 4. @gpespn B+
  5. 5. @gpespn C-
  6. 6. @gpespn New Feature! Guest sessions
  7. 7. @gpespn
  8. 8. @gpespn F-
  9. 9. @gpespn I just want to send a message to an object
  10. 10. @gpespn -W oof! -M eow !
  11. 11. @gpespn Polymorphism tell don't ask
  12. 12. @gpespn
  13. 13. @gpespn
  14. 14. @gpespn
  15. 15. @gpespn still have conditional!
  16. 16. @gpespn Create a high level abstract class
  17. 17. @gpespn
  18. 18. @gpespn Abstract Subclass Subclass
  19. 19. @gpespn Polymorphism
  20. 20. @gpespn
  21. 21. @gpespn Whats the catch? • Parallel interfaces • Design patterns that are confusing to those unfamiliar to them • New words/vocabulary into application. LOC went up! • Increased big picture complexity in exchange for macro clarity • Too many Objects
  22. 22. @gpespn
  23. 23. @gpespn Questions?

×