Solving architectural problems with OOP in pictures

Solving architectural problems with OOP in pictures

1) Recording of the talk (in Russian): https://www.youtube.com/watch?v=NnQCzhZBN0Y
2) List of concepts to illustrate: https://github.com/inem/visual-oop-guide/tree/master/concepts
3) "Polly want a Message" talk by Sandi Metz : https://www.deconstructconf.com/2018/sandi-metz-polly-want-a-message

F9c1a378a1e3926ea1a58cf724140000?s=128

Ivan Nemytchenko

September 28, 2019
Tweet

Transcript

  1. Solving architectural problems with OOP in pictures Ivan Nemytchenko, railshurts.com,

    @inem RubyRussia 2019
  2. What’s the problem? Abstractions on top of abstractions on top

    of other abstractions!
  3. What’s the problem? Very hard to see the big picture

    in real projects
  4. What’s the problem? Very hard to see the big picture

    in real projects UML :(
  5. What’s the problem? Very hard to SEE the big picture

    in real projects CRC Cards
  6. What’s the problem? Code quality metrics are non-actionable So what?

  7. What to expect here? 1. It is gonna be fun!

    2. You’ll become better at: • Learning, teaching, explaining, understanding • Visualizing big picture, architecture flaws, code quality
  8. How to illustrate Dependency Injection * with one picture **

    so that everyone understands ?
  9. About me • Speaking • Teaching (GoodProgramer.ru) • Learning (RailsHurts.com)

    • Freelancing • GitLab Fan • Omsk → Belgrade, Serbia
  10. OOP in pictures Foundation Advanced concepts Using in practice

  11. “Smart kettle” task Boil water correctly and safely! 1. No

    code 2. Just classes 3. And their methods
  12. Kettle components (objects) small dudes == objects

  13. Kettle components (objects) small dudes == objects

  14. Objects with methods! hands == methods

  15. A method number of fingers == number of arguments

  16. Instance variables Stored inside the brain

  17. Instance variables Can be reused later

  18. А как тогда будет выглядеть…

  19. Returning results

  20. Private methods

  21. Exception

  22. Anti-patterns

  23. Too many arguments

  24. Too many methods

  25. Too long methods

  26. Too many instance variables

  27. Too much conditional logic in methods Руки-базуки

  28. Too much of everything!!!

  29. OOP in pictures Foundation Advanced concepts Using in practice

  30. Polymorphism same number of hands with same number of fingers

  31. None
  32. None
  33. None
  34. None
  35. Classes A spawning platform

  36. Classes A spawning platform

  37. same topology Object & classes have the

  38. Topology Кружка и бублик имеют одинаковую топологию

  39. same topology Object & classes have the

  40. Execution flow

  41. Execution flow

  42. Execution flow

  43. Execution flow

  44. Execution flow

  45. Execution flow

  46. Execution flow

  47. Execution flow

  48. Dependencies have to remember about classes to use them

  49. Dependencies

  50. Side effects

  51. Dependency Injection Instead of remembering thing we pass them as

    arguments
  52. None
  53. OOP in pictures Foundation Advanced concepts Using in practice

  54. Visual language!

  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. Big picture

  67. Big picture in dynamics

  68. Big picture in dynamics

  69. Big picture in dynamics

  70. Big picture in dynamics

  71. None
  72. None
  73. None
  74. None
  75. None
  76. None
  77. None
  78. OOP in pictures Foundation Advanced concepts Using in practice

  79. None
  80. • Big picture • Modelling • Documenting • Sharing knowledge

    • Explaining What can you use it for
  81. • ТРИЗ • Максвел • Курпатов It is a big

    deal!
  82. Ivan Nemytchenko, railshurts.com, @inem RubyRussia 2019 Questions