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

Embrace the Browser, Architect’s Edition

Embrace the Browser, Architect’s Edition

Abstract: Progressive enhancement is a technique mostly known to, and practiced by, designers and front-end developers. In many large projects, the most important decisions (a.k.a. “architecture”) are made by backend architects, who couldn’t care less about frontend “details”. But they should! In this talk, I’ll try to explore some reasons how adopting the architecture of the web in general, and the capabilities of the browser in particular, improves the overall architecture.

Presented at EnhanceConf 2016, London

Stefan Tilkov

March 04, 2016
Tweet

More Decks by Stefan Tilkov

Other Decks in Technology

Transcript

  1. How to Embrace the Browser, Architect’s Edition Stefan Tilkov, innoQ

    @stilkov enhanceconf London
 4 March, 2016
  2. Lessons from the past: CORBA > Once, there was this

    thing called CORBA > It was supposed to rule the world! > The browser came along, using some stupid text-based protocol > Thank God it got CORBA support! > Everyone was supposed to switch to it …
  3. Lessons from the past: WS-* > “We can’t ignore this

    Web thing anymore” > “Let’s just do RCP over XML and HTTP” > “Port 80 is open, so let’s use it!” > Re-invent IIOP, IDL, CORBA Services as SOAP, WSDL, WS-* > Proprietary integration > Strong vendor support
  4. Anatomy of a SOAP “Web service” > Doesn’t expose individual

    resources with URIs > No links, no forms, no hypermedia > Uses HTTP as a transport > Can’t use advanced HTTP features (e.g. caching) > Specific instead of generic > “Tunnels” through the Web
  5. That “REST” thing > Architectural style, defined after the fact

    > Identification of resources, HatEoAS, self-descriptive messages, representations > Highlighted what contstraints need to be adhered to gain benefits, and what tradeoffs involved are
  6. RESTful Web services > Embrace, don’t oppose, the Web’s architecture

    > Exchange local optimum for benefits of generic approach > Simpler > More efficient > More interoperable
  7. Rendered on Client Rendered on Server Desktop Mobile Set top

    Web App Native App Frontend, we’ve got frontends Frontend Hybrid
  8. Rendered on Client Rendered on Server Desktop Mobile Set top

    Web App Native App Frontend, we’ve got frontends Frontend Hybrid
  9. “Web service”1) > Use HTTP as transport > Ignore verbs

    > Ignores URIs > Expose single “endpoint” > Fails to embrace the Web 1) in the SOAP/WSDL sense “Web app”2) > Uses browser as runtime > Ignores forward, back, refresh > Does not support linking > Exposes monolithic “app” > Fails to embrace the browser 2) built as a careless SPA
  10. The web-native way of distributing logic Process Flow Presentation Domain

    Logic Data Server Client > Rendering, layout, styling
 on an unknown client > Logic & state machine on server > Client user-agent extensible via
 code on demand
  11. $('.multiselect', context).each(function() {
 $(this).multiselect({
 selectedList: 2,
 checkAllText: "Alle",
 uncheckAllText: "Keinen"


    }).multiselectfilter({label:"",
 width:"200px"});
 }); <div class="filter-column">
 <label for="project">Project</label>
 <select class="multiselect" id="project"
 name="project" size="5" multiple>
 <option>DISCOVER</option>
 <option>IMPROVE</option>
 <option >MAGENTA</option>
 <option>ROCA</option>
 <option>ROCKET</option>
 </select>
 </div>
  12. HTML & Hypermedia > In REST, servers expose a hypermedia

    format > Option 1: Just use HTML > Option 2: Just invent your own JSON-based, incomplete clone > Clients need to be RESTful, too > Option 1: Use the browser > Option 2: Invent your own, JS-based, buggy, incomplete implementation
  13. Any sufficiently complicated JavaScript client application contains an ad hoc,

    informally-specified, bug-ridden, slow implementation of half a browser. (Me, with apologies to Phillip Greenspun)
  14. Application Application Application Application > Clients should be modularized as

    much as servers (cf. μServices) > Browser as platform > How to connect separate UIs?
  15. Backend platform goals > As few assumptions as possible >

    No implementation dependencies > Small interface surface > Based on standards > Parallel development > Independent deployment > Autonomous operations Backend Platform
  16. What’s the frontend platform analogy? > As few assumptions as

    possible > No implementation dependencies > Small interface surface > Based on standards > Parallel development > Independent deployment > Autonomous operations Backend Platform Frontend Platform
  17. The browser as a platform > Independent applications > Loosely

    coupled > Separately deployable > Based on standard platform > Updated on the fly > Any device Backend Platform Frontend Platform
  18. How to get away with “just” the Web > Mobile

    first > Responsive design > Progressive enhancement > Shared assets > Pull vs. push > Sacrifice (some) efficiency Small frontends, loosely coupled
  19. Stefan Tilkov
 [email protected]
 Phone: +49 170 471 2625 innoQ Deutschland

    GmbH Krischerstr. 100 40789 Monheim am Rhein Germany Phone: +49 2173 3366-0 innoQ Schweiz GmbH Gewerbestr. 11 CH-6330 Cham Switzerland Phone: +41 41 743 0116 www.innoq.com Ohlauer Straße 43 10999 Berlin Germany Phone: +49 2173 3366-0 Ludwigstr. 180E 63067 Offenbach Germany Phone: +49 2173 3366-0 Kreuzstraße 16
 80331 München Germany Phone: +49 2173 3366-0 Thank you – that’s all I have. @stilkov