LT 08 - Guilherme Silveira - Cache hipermidia

64
Rest in Practice: Hypermedia and Services Guilherme Silveira Wednesday, June 8, 2011

Transcript of LT 08 - Guilherme Silveira - Cache hipermidia

Page 1: LT 08 - Guilherme Silveira - Cache hipermidia

Rest in Practice:Hypermedia and Services

Guilherme Silveira

Wednesday, June 8, 2011

Page 2: LT 08 - Guilherme Silveira - Cache hipermidia

Guilherme Silveira

Wednesday, June 8, 2011

Page 3: LT 08 - Guilherme Silveira - Cache hipermidia

@guilhermecaelum

[email protected]

Wednesday, June 8, 2011

Page 4: LT 08 - Guilherme Silveira - Cache hipermidia

11 years, 1992: “Basic”

Wednesday, June 8, 2011

Page 5: LT 08 - Guilherme Silveira - Cache hipermidia

2002 guj.com.br2003 vraptor

Wednesday, June 8, 2011

Page 6: LT 08 - Guilherme Silveira - Cache hipermidia

2004 extreme programming

2006 scrum

...

Wednesday, June 8, 2011

Page 7: LT 08 - Guilherme Silveira - Cache hipermidia

2009 restfulie

http://restfulie.caelumobjects.com/

Wednesday, June 8, 2011

Page 8: LT 08 - Guilherme Silveira - Cache hipermidia

2010 tectura

http://www.tectura.com.br

Wednesday, June 8, 2011

Page 9: LT 08 - Guilherme Silveira - Cache hipermidia

2004 caelum - daily life

www.caelum.com.br

Wednesday, June 8, 2011

Page 10: LT 08 - Guilherme Silveira - Cache hipermidia

blogs

blog.caelum.com.bragilenomundoreal.com.brblog.caelumobjects.com

Wednesday, June 8, 2011

Page 11: LT 08 - Guilherme Silveira - Cache hipermidia

bank.com

Wednesday, June 8, 2011

Page 12: LT 08 - Guilherme Silveira - Cache hipermidia

calendar.combank.com

Wednesday, June 8, 2011

Page 13: LT 08 - Guilherme Silveira - Cache hipermidia

calendar.com

travel.com

bank.com

Wednesday, June 8, 2011

Page 14: LT 08 - Guilherme Silveira - Cache hipermidia

calendar.com

travel.com company.com

bank.com

Wednesday, June 8, 2011

Page 15: LT 08 - Guilherme Silveira - Cache hipermidia

calendar.com

travel.com company.com

bank.com

Wednesday, June 8, 2011

Page 16: LT 08 - Guilherme Silveira - Cache hipermidia

what is the future of integration over the web?

Wednesday, June 8, 2011

Page 17: LT 08 - Guilherme Silveira - Cache hipermidia

what was REST?

Wednesday, June 8, 2011

Page 18: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

Services

Web

Wednesday, June 8, 2011

Page 19: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

Servicescreate a saas account

Web

Wednesday, June 8, 2011

Page 20: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

Servicescreate a saas account

freeze account

Web

Wednesday, June 8, 2011

Page 21: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

Servicescreate a saas account

freeze account

reactivate account

Web

Wednesday, June 8, 2011

Page 22: LT 08 - Guilherme Silveira - Cache hipermidia

Restful Services

Web

Wednesday, June 8, 2011

Page 23: LT 08 - Guilherme Silveira - Cache hipermidia

Restful Services

http

Web

Wednesday, June 8, 2011

Page 24: LT 08 - Guilherme Silveira - Cache hipermidia

Restful Services

http

port 80

Web

Wednesday, June 8, 2011

Page 25: LT 08 - Guilherme Silveira - Cache hipermidia

Restful Services

http

port 80

firewall heaven

Web

Wednesday, June 8, 2011

Page 26: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

ServicesWeb

Wednesday, June 8, 2011

Page 27: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

Services

xml, json

Web

Wednesday, June 8, 2011

Page 28: LT 08 - Guilherme Silveira - Cache hipermidia

Restful

Services

xml, json

get, post, ...

Web

Wednesday, June 8, 2011

Page 29: LT 08 - Guilherme Silveira - Cache hipermidia

unresttrips.com: flight details

<?xml version="1.0" encoding="UTF-8" standalum="yes"?><flight> <information> <from>sao paulo</from> <to>seoul</to> </information>  <value>900.00</value></flight>

Wednesday, June 8, 2011

Page 30: LT 08 - Guilherme Silveira - Cache hipermidia

service locator when integrating:

coupling++

guilherme

unresttrips.com

unrest pay

Wednesday, June 8, 2011

Page 31: LT 08 - Guilherme Silveira - Cache hipermidia

service locator when integrating:

coupling++

guilherme

unresttrips.com

unrest pay

Wednesday, June 8, 2011

Page 32: LT 08 - Guilherme Silveira - Cache hipermidia

resttrips.com: flight details

<?xml version="1.0" encoding="UTF-8" standalum="yes"?><flight> <information> <from>sao paulo</from> <to>seoul</to> </information>  <value>900.00</value> <link rel="payment" href="http://resttrips.com/payment/custom"/></flight>

Wednesday, June 8, 2011

Page 33: LT 08 - Guilherme Silveira - Cache hipermidia

resttrips.com: making the payment

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value);

Wednesday, June 8, 2011

Page 34: LT 08 - Guilherme Silveira - Cache hipermidia

resttrips.com: changing its payment provider

<?xml version="1.0" encoding="UTF-8" standalum="yes"?><flight> <information> <from>sao paulo</from> <to>seoul</to> </information>  <value>900.00</value> <link rel="payment" href="http://paysite.com/custom"/></flight>

Wednesday, June 8, 2011

Page 35: LT 08 - Guilherme Silveira - Cache hipermidia

dependency injection when integrating:

coupling--

guilherme

resttrips.com

paysite.com

restrips pay

Wednesday, June 8, 2011

Page 36: LT 08 - Guilherme Silveira - Cache hipermidia

dependency injection when integrating:

coupling--

guilherme

resttrips.com

paysite.com

restrips pay

Wednesday, June 8, 2011

Page 37: LT 08 - Guilherme Silveira - Cache hipermidia

i never travel alone

Wednesday, June 8, 2011

Page 38: LT 08 - Guilherme Silveira - Cache hipermidia

my friendsergio

Wednesday, June 8, 2011

Page 39: LT 08 - Guilherme Silveira - Cache hipermidia

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value/2);

// send the payment link to another part of the web

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value/2);

resttrips.com: sharing a trip

Wednesday, June 8, 2011

Page 40: LT 08 - Guilherme Silveira - Cache hipermidia

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value/2);

// send the payment link to another part of the web

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value/2);

resttrips.com: sharing a trip

Wednesday, June 8, 2011

Page 41: LT 08 - Guilherme Silveira - Cache hipermidia

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value/2);

// send the payment link to another part of the web

flight = Client.at('http://resttrips.com/f/574XR4').get();

confirmation = flight.getLink("payment"). patch(cardInformation, value/2);

resttrips.com: sharing a trip

Wednesday, June 8, 2011

Page 42: LT 08 - Guilherme Silveira - Cache hipermidia

myself = Client.at('http://users.calendar.com') .with(auth).get();

myself.link("calendar").patch(flight.link("self"));

calendar: integrating my systems

Wednesday, June 8, 2011

Page 43: LT 08 - Guilherme Silveira - Cache hipermidia

myself = Client.at('http://users.calendar.com') .with(auth).get();

myself.link("calendar").patch(flight.link("self"));

calendar: integrating my systems

Wednesday, June 8, 2011

Page 44: LT 08 - Guilherme Silveira - Cache hipermidia

me.link("calendar").patch(link_to_birthday_list)me.link("calendar").patch(link_to_hotel_reservation)me.link("calendar").patch(link_to_trip_details)

calendar: more examples

Wednesday, June 8, 2011

Page 45: LT 08 - Guilherme Silveira - Cache hipermidia

so what?

Wednesday, June 8, 2011

Page 46: LT 08 - Guilherme Silveira - Cache hipermidia

so what?

Any update on the flight ==> reflects hereAny update on the hotel ==> reflects hereAny update on the meeting ==> reflects here

Wednesday, June 8, 2011

Page 47: LT 08 - Guilherme Silveira - Cache hipermidia

so what?

Any update on the flight ==> reflects hereAny update on the hotel ==> reflects hereAny update on the meeting ==> reflects here

don’t just u

se, integrate!

Wednesday, June 8, 2011

Page 48: LT 08 - Guilherme Silveira - Cache hipermidia

so what? that was just keeping an URI.

Wednesday, June 8, 2011

Page 49: LT 08 - Guilherme Silveira - Cache hipermidia

so what? that was just keeping an URI.

Remove ==> Cancels the flightRemove ==> Cancels the reservationRemove ==> Emails your coworkers

Wednesday, June 8, 2011

Page 50: LT 08 - Guilherme Silveira - Cache hipermidia

so what? that was just keeping an URI.

Remove ==> Cancels the flightRemove ==> Cancels the reservationRemove ==> Emails your coworkers

do not central

ize control!

Wednesday, June 8, 2011

Page 51: LT 08 - Guilherme Silveira - Cache hipermidia

does our ‘rest’ systems built in

2010work this way?

Wednesday, June 8, 2011

Page 52: LT 08 - Guilherme Silveira - Cache hipermidia

so what? that was just keeping an URI.

Remove ==> Cancels the flightRemove ==> Cancels the reservationRemove ==> Emails your coworkers

Wednesday, June 8, 2011

Page 53: LT 08 - Guilherme Silveira - Cache hipermidia

so what? that was just keeping an URI.

Remove ==> Cancels the flightRemove ==> Cancels the reservationRemove ==> Emails your coworkers

but which format?

Wednesday, June 8, 2011

Page 54: LT 08 - Guilherme Silveira - Cache hipermidia

#json, #xml, #soap #etc?

Wednesday, June 8, 2011

Page 55: LT 08 - Guilherme Silveira - Cache hipermidia

which #json, #xml #etc?

Wednesday, June 8, 2011

Page 56: LT 08 - Guilherme Silveira - Cache hipermidia

exercise

Wednesday, June 8, 2011

Page 57: LT 08 - Guilherme Silveira - Cache hipermidia

so what?

Wednesday, June 8, 2011

Page 58: LT 08 - Guilherme Silveira - Cache hipermidia

so what?

micro formats, media types, rdf etc

Wednesday, June 8, 2011

Page 59: LT 08 - Guilherme Silveira - Cache hipermidia

so what?

micro formats, media types, rdf etc

micro formats

with hyperlinks!

Wednesday, June 8, 2011

Page 60: LT 08 - Guilherme Silveira - Cache hipermidia

integration over the web

Wednesday, June 8, 2011

Page 61: LT 08 - Guilherme Silveira - Cache hipermidia

must ignore

Wednesday, June 8, 2011

Page 62: LT 08 - Guilherme Silveira - Cache hipermidia

bottom up

microformat

mime type?

design by committe

controlled vocabulary

Wednesday, June 8, 2011

Page 63: LT 08 - Guilherme Silveira - Cache hipermidia

hypermediaintegration over the web

Wednesday, June 8, 2011