Pro Yearly is on sale from $80 to $50! »

Less Abstract! Surprising effects of expressing OOP in pictures

Less Abstract! Surprising effects of expressing OOP in pictures

F9c1a378a1e3926ea1a58cf724140000?s=128

Ivan Nemytchenko

November 18, 2019
Tweet

Transcript

  1. Less Abstract! Effects of expressing OOP in pictures Ivan Nemytchenko

    @inemation inem.at
  2. Who is this guy? • Educator • Freelance consultant •

    Complexity fighter • GitLab fan • Serbian Siberian • inem.at • @inemation
  3. Serbian Siberian ??

  4. I am Russian

  5. None
  6. None
  7. Omsk is in Siberia

  8. I live in Serbia

  9. Serbia != Siberia

  10. Serbia != Siberia != Syria

  11. What’s the problem? Abstractions on top of abstractions on top

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

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

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

    in real projects UML :(
  15. What to expect here? 1. It is gonna be fun!

    2. You’ll become better at: • Learning, teaching, explaining complex concepts • Visualizing big picture • Finding architecture flaws •Tracking dynamics
  16. OOP in pictures Foundation Advanced concepts Using in practice

  17. How to illustrate Dependency Injection * with one picture **

    so that everyone understands ?
  18. “Smart kettle” task Boil water correctly and safely! 1. No

    code 2. Just classes 3. And their methods
  19. Artistic soldiers method

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

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

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

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

  24. Objects with methods! arms == methods

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

  26. Instance variables Stored inside the brain

  27. Instance variables Can be reused later

  28. But how other stuff is going to look like?…

  29. Returning results door on the body

  30. Private methods “internal arms”

  31. Exception puking

  32. Basic anti-patterns

  33. Too many arguments

  34. Too many methods

  35. Too long methods

  36. Too many instance variables

  37. Too much conditional logic in methods Swallen arms

  38. Too much of everything!!!

  39. OOP in pictures Foundation Advanced concepts Using in practice

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

  41. None
  42. None
  43. Classes A spawning platforms

  44. Classes A spawning platform

  45. same topology Object & classes have the

  46. Topology Cups and donuts share the same topology

  47. same topology Object & classes have the

  48. Execution flow

  49. Execution flow

  50. Execution flow

  51. Execution flow == Rube Goldberg machine

  52. Execution flow

  53. Execution flow

  54. Execution flow

  55. Dependencies have to remember about classes to use them

  56. Dependencies

  57. Side effects

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

    arguments
  59. None
  60. OOP in pictures Foundation Advanced concepts Using in practice

  61. Visual language!

  62. None
  63. None
  64. None
  65. None
  66. None
  67. None
  68. None
  69. None
  70. None
  71. None
  72. None
  73. Big picture

  74. Dynamic anti-patterns

  75. Dynamic anti-patterns

  76. Dynamic anti-patterns

  77. Dynamic anti-patterns

  78. Dynamic anti-patterns

  79. None
  80. None
  81. None
  82. None
  83. None
  84. None
  85. None
  86. OOP in pictures Foundation Advanced concepts Using in practice

  87. None
  88. – George Box “All models are wrong but some are

    useful.”
  89. • Big picture • Modelling • Documenting • Sharing knowledge

    • Explaining What can you use it for
  90. Ivan Nemytchenko, inem.at, @inemation RubyConf 2019 Questions?