49
TAKING THE HYPE OUT OF HYPERMEDIA ryan.lemmer @ factor10 .com // @ryanlemmer // GMT+2

Taking the Hype out of Hypermedia

Embed Size (px)

DESCRIPTION

Slides for my talk @ RubyFuza 2012

Citation preview

Page 1: Taking the Hype out of Hypermedia

TAKING THE HYPE OUT OF HYPERMEDIA

[email protected] // @ryanlemmer // GMT+2

Page 2: Taking the Hype out of Hypermedia

BUILDING UI

Page 3: Taking the Hype out of Hypermedia

TEMPLATE DRIVEN

Page 4: Taking the Hype out of Hypermedia

TEMPLATE DRIVEN

<table><tr><td> <%= @cart.total %> </td>...

</tr></table>

Page 5: Taking the Hype out of Hypermedia

DATA + TEMPLATE DRIVEN

Page 6: Taking the Hype out of Hypermedia

DATA + TEMPLATE DRIVEN

{ total: 987, discount: 10, ...}

Page 7: Taking the Hype out of Hypermedia

DATA + TEMPLATE DRIVEN

{ total: 987, discount: 10, ...}

AJAX GET /cart/1

Page 8: Taking the Hype out of Hypermedia

CONSISTENCY

Page 9: Taking the Hype out of Hypermedia

CONSISTENCY

Page 10: Taking the Hype out of Hypermedia

CONSISTENCY

Page 11: Taking the Hype out of Hypermedia

CONSISTENCY

Page 12: Taking the Hype out of Hypermedia

CONSISTENCY

... MAKES TESTABILITY TOUGH

(LACK OF)

Page 13: Taking the Hype out of Hypermedia

TESTABILITYto test, you need a (nice) handle on the situation

Page 14: Taking the Hype out of Hypermedia

TESTABILITYto test, you need a (nice) handle on the situation

# capybarait "signs me in" do within("#session") do fill_in 'Login', :with => '[email protected]' fill_in 'Password', :with => 'secrat(sic)' end click_link 'Sign in'end

Page 15: Taking the Hype out of Hypermedia

INTERACTIONS

Page 16: Taking the Hype out of Hypermedia

INTERACTIONS

Page 17: Taking the Hype out of Hypermedia

INTERACTIONS

Page 18: Taking the Hype out of Hypermedia

INTERACTIONS

Page 19: Taking the Hype out of Hypermedia

INTERACTIONSIMPLICIT

Page 20: Taking the Hype out of Hypermedia

INTERACTIONSIMPLICIT

def update_item_qty @item = @cart.items.find(params[:id])

if @item.update_attributes(:quantity => params[:qty]) redirect_to(@item) else render "edit" endend

Page 21: Taking the Hype out of Hypermedia

LAY OF THE LAND

Page 22: Taking the Hype out of Hypermedia

LAY OF THE LAND

Page 23: Taking the Hype out of Hypermedia

LAY OF THE LAND

Page 24: Taking the Hype out of Hypermedia

LAY OF THE LAND

Page 25: Taking the Hype out of Hypermedia

HYPERMEDIA DRIVEN

Page 26: Taking the Hype out of Hypermedia

HYPERMEDIA DRIVEN

{ data: {

total: 987, discount: 10, ...},

links: {{rel: “checkout” uri: “...”}

}

Page 27: Taking the Hype out of Hypermedia

HYPERMEDIA DRIVEN

{ data: {

total: 987, discount: 10, ...},

links: {{rel: “checkout” uri: “...”}

}

after /checkout

{ data: {

total: 987, discount: 10, ...},

links: {}}

Page 28: Taking the Hype out of Hypermedia

HYPERMEDIA DSL

Page 29: Taking the Hype out of Hypermedia

HYPERMEDIA DSLGET /cart/12312312

Page 30: Taking the Hype out of Hypermedia

HYPERMEDIA DSLGET /cart/12312312

POST /cart/12312312

Page 31: Taking the Hype out of Hypermedia

HYPERMEDIA

Page 32: Taking the Hype out of Hypermedia

HYPERMEDIA

Page 33: Taking the Hype out of Hypermedia

HYPERMEDIA

only for “open” carts

Page 34: Taking the Hype out of Hypermedia

HYPERMEDIA+STATEMACHINE

Page 35: Taking the Hype out of Hypermedia

HYPERMEDIA+STATEMACHINE

NEXT STEP ??

Page 36: Taking the Hype out of Hypermedia

HYPERMEDIA+STATEMACHINE

NEXT STEP ??

resource state machine

Page 37: Taking the Hype out of Hypermedia

HYPERMEDIA+STATEMACHINE

NEXT STEP ??

resource state machine

only checkout if cart is “open”

Page 38: Taking the Hype out of Hypermedia

EXPLICIT INTERACTIONS

Page 39: Taking the Hype out of Hypermedia

EXPLICIT INTERACTIONS

SERVER SIDE INTERACTION

LAYER

Page 40: Taking the Hype out of Hypermedia

EXPLICIT INTERACTIONS

SERVER SIDE INTERACTION

LAYER

HATEOAS

Page 41: Taking the Hype out of Hypermedia

INTERACTION LAYER

Page 42: Taking the Hype out of Hypermedia

INTERACTION LAYER

“STRUCTURE”

HYPERMEDIA “FLOW”

Page 43: Taking the Hype out of Hypermedia

AND CONSISTENCY?

Page 44: Taking the Hype out of Hypermedia

AND CONSISTENCY?

removethen RELOAD

Page 45: Taking the Hype out of Hypermedia

AND CONSISTENCY?

removethen RELOAD

Page 46: Taking the Hype out of Hypermedia

ARCHITECTURE

Page 47: Taking the Hype out of Hypermedia

ARCHITECTURE

Page 48: Taking the Hype out of Hypermedia

WHAT’S NEXT?* Smart Hypermedia clients* Hypermedia Types => (HTML Forms, ATOM, ...)* machine-to-machine API’s => dynamic, executable

Page 49: Taking the Hype out of Hypermedia

THANKSaslam khan

andreas brinklennart ohlsson

@factor10