Slide 1

Slide 1 text

Building modern web apps Single Responsibility Principle applied

Slide 2

Slide 2 text

Michal Ostruszka @mostruszka | michalostruszka.pl both-ends developer I crafting web applications

Slide 3

Slide 3 text

What not to expect? / code samples / frameworks / benchmarks / etc @mostruszka / #geecon

Slide 4

Slide 4 text

Here be dragons / old times, good times? / what projects need / how to / toolbox / not all is well / profits @mostruszka / #geecon

Slide 5

Slide 5 text

Single Responsibility do you speak it? In object-oriented programming, the Single Responsibility Principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. @mostruszka / #geecon

Slide 6

Slide 6 text

JavaScript all the things! @mostruszka / #geecon

Slide 7

Slide 7 text

Web app business logic AND view logic @mostruszka / #geecon

Slide 8

Slide 8 text

High coupling presentation business logic @mostruszka / #geecon

Slide 9

Slide 9 text

Shotgun surgery deployment risk @mostruszka / #geecon

Slide 10

Slide 10 text

Backend devs doing frontend @mostruszka / #geecon

Slide 11

Slide 11 text

Backend devs doing frontend / architecture / standards & browser support / performance @mostruszka / #geecon

Slide 12

Slide 12 text

Project needs / user experience / good performance / standards & browser support / maintainability / minimal-risk deployments @mostruszka / #geecon

Slide 13

Slide 13 text

Answer apply SRP on app level! @mostruszka / #geecon

Slide 14

Slide 14 text

Built by experts both apps built by highly-skilled teams @mostruszka / #geecon

Slide 15

Slide 15 text

Unlearn what you have learned you must @mostruszka / #geecon

Slide 16

Slide 16 text

API JSON-based view-less server browser as API client GET /api/users HTTP/1.1 Host: example.com Accept: application/json HTTP/1.1 200 OK Content-Type: application/json {"foo": "bar"} @mostruszka / #geecon

Slide 17

Slide 17 text

Source separation isolate frontend code @mostruszka / #geecon

Slide 18

Slide 18 text

Deployment isolation static stuff is static *.html *.js *.css *.png *.java *.rb *.scala *.php @mostruszka / #geecon

Slide 19

Slide 19 text

Need one build? build frontend as one of build steps @mostruszka / #geecon

Slide 20

Slide 20 text

Benefits right tools for the job @mostruszka / #geecon

Slide 21

Slide 21 text

Build toolbox for frontend / grunt, gulp / yeoman, lineman / make, ant + tons of extensions @mostruszka / #geecon

Slide 22

Slide 22 text

Backend / web as a transport layer only / micro web-frameworks / auto-documenting API / JSON standards @mostruszka / #geecon

Slide 23

Slide 23 text

One SPA fits all? not so fast, cowboy / SEO, indexing / Twitter’s time to first tweet / view-heavy apps / additional code to maintain @mostruszka / #geecon

Slide 24

Slide 24 text

node.js to the rescue? @mostruszka / #geecon

Slide 25

Slide 25 text

node.js / middle layer / view server by JS devs / talks to backend API http://www.nczonline.net/blog/2013/10/07/node-js-and-the-new-web-front-end/ @mostruszka / #geecon

Slide 26

Slide 26 text

backend / focus on business logic & core / keep well defined boundary / no more JS nightmares / independent development cycle Happy end @mostruszka / #geecon

Slide 27

Slide 27 text

frontend / focus on client logic & view / use well-defined API / deliver great user experience / use right tools / drive design, automate, test Happy end @mostruszka / #geecon

Slide 28

Slide 28 text

questions? .finish(now) @mostruszka / #geecon

Slide 29

Slide 29 text

https://www.flickr.com/photos/nhoulihan/3560187593/ https://www.flickr.com/photos/notbrucelee/7219422352/ http://www.sapdesignguild.org/editions/edition1/walo1.asp http://www.quickmeme.com/meme/35pvym https://www.flickr.com/photos/matkalla/3990633574/ https://www.flickr.com/photos/ross/4368015/ https://www.flickr.com/photos/nostri-imago/3461159301 http://www.keepcalm-o-matic.co.uk/p/keep-calm-and-call-jason-bourne-2/ http://kaminopedia.wikia.com/wiki/Yoda Credits @mostruszka / #geecon