Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The scary fairy tale about MVC or How to stop worrying and start to write ruby code

The scary fairy tale about MVC or How to stop worrying and start to write ruby code

Hotcode conference, 5 May 2013

Andrey Savchenko

May 31, 2013
Tweet

More Decks by Andrey Savchenko

Other Decks in Programming

Transcript

  1. The scary fairy tale about MVC How to stop worrying

    and start to write ruby code or
  2. Cast • Little Red Riding Hood - developer • Grandmother

    - customers • The map - MVC • Compass - Rails And others…
  3. nce upon a time, a little girl goes trough the

    scary wood to deliver pies to her grandmother. O
  4. here you are going, little girl? he asked. I’m going

    to deliver pies to my grandma – she answered. W –
  5. have a present for you – wolf said. Take this

    map and this compass: it works very well for me. I
  6. he girl took gifts and moved on. And have lost

    in the wood. Because the compass was point to the wolf’s grandmother and map defines the ways not applicable for little girls. T
  7. The controller should delegate the work that needs to be

    done to other objects; it coordinates or controls the activity. It should not do much work itself. GRASP controller definition
  8. M

  9. M

  10. M

  11. Metrics • WPM - WTFs per minute • SLOC/M -

    Source lines of code per method
  12. Metrics • WPM - WTFs per minute • SLOC/M -

    Source lines of code per method • SLOC/C - Source lines of code per class
  13. Use-case strategy • Doesn’t work with Rails • Requires to

    build your own stack • But once you build this – its bullet-proof
  14. Onion strategy • Do work with Rails • Layer can

    be just Plain Old Ruby Object • Layers is hard to naming
  15. Questions? Andrey Savchenko Aejis* * we are hiring** ** if

    you understand the problem described in talk