RESThub<br />What is RESThub ?<br />Three independant layers<br />Security<br />Hosting<br />Demos<br />
What is RESThub ?<br />http://resthub.org<br />
What is RESThub ?<br />Javascript Stack<br />Java WebserviceStack<br />Security & Identity<br /> Generic Tests<br />Docume...
Keywords behind RESThub<br />
Generic DAO & Business Services<br />HadesDao<br />TESTED<br />Generic<br />Tested<br />Extendable<br />« extends »<br />G...
Generic DAO & Business Services<br />Provides…<br />CRUD methods (Create, Retrieve, Update, Delete)<br />Allows…<br />Save...
Basic Example<br />How to… obtain a complete DAO layer for my POJO?<br />@Named("plopDao")<br />publicclass PlopJpaDao ext...
DAO & Business Services stack<br />Out of the box configuration<br />Identity manager<br />Multi-modules JPA entities scan...
Generic REST Web Services<br />Provides…<br />Generic methods to access business services<br />XML and JSON objects serial...
Basic Example<br />How to… retrieve a persisted object in database ?<br />@GET<br />@Path("/{id}")<br />@Produces({MediaTy...
Webservices stack<br />JSON Serialization<br />OAuth2 based security<br />Jackson 1.5<br />7.1<br />Run/Debug/Tests web ap...
Generic Tests<br />Provides<br />Generic methods to test your DAO, Business services and Webservices<br />Better protectio...
Basic Example<br />How to… entirely test my DAO layer ?<br />publicclass PlopDaoTest extends AbstractDaoTest<Plop, PlopDao...
Use case 1 : RESThub + MVC Framework<br />        Tapestry5    website<br />Webservices<br />Server side<br />DAO and Serv...
Use case 2 : RESThub full stack<br />JavaScript stackbasedWebsite<br />Client side<br />Webservices<br />Server side<br />...
Javascript Stack for RIA WebApps<br />Provides…<br />Script loader<br />Route manager<br />Templating language<br />Allows...
Wellknownwebapp software design<br />Web browser<br />Reloading page for each action<br />Dynamic pages<br />Application s...
RESThub based webapp software design<br />Web browser<br />Changing the state of one widget on each action<br />Script loa...
JavaScript stack<br />JavaScript library<br />1.4<br />Client side templating<br />JavaScript stack core<br />RESThub cont...
Consequences on the architecture<br />Server is stateless<br />Can change just a small part of the page<br />Each part is ...
RESThub on hostingside<br />Clear separation between static and dynamic<br />Static: interface HTML5, JS, CSS<br />Dynamic...
Security based on OAuth2<br />OAuth 2.0 basedauthentication<br />Work in progress IETF standard<br />Tokenbased<br />Used ...
OAuth2 use case<br />
Current flow<br />
Demos<br />Bookingdemo<br />Hotelbooking Web application<br />Hotelsearchengine<br />Consult & cancel bookings<br />Roundt...
RESThub sample : Roundtable<br />
RESThub sample : Booking<br />
JavaScript<br />HTML<br />Route 1<br />Controller A<br />View A<br />Route 2<br />Controller B<br />View B<br />Route 3<br...
Booking example (2)<br />booking/book.js<br />mode=edit<br />hotel/view.js<br />click(proceed)<br />booking/edit.js<br />b...
Upcoming SlideShare
Loading in …5
×

Resthub

3,873 views

Published on

Fullstack Java toolkit built with HTML5 in mind …

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,873
On SlideShare
0
From Embeds
0
Number of Embeds
1,062
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Resthub

  1. 1. RESThub<br />What is RESThub ?<br />Three independant layers<br />Security<br />Hosting<br />Demos<br />
  2. 2. What is RESThub ?<br />http://resthub.org<br />
  3. 3. What is RESThub ?<br />Javascript Stack<br />Java WebserviceStack<br />Security & Identity<br /> Generic Tests<br />Documentation<br />Java Middle Stack<br />
  4. 4. Keywords behind RESThub<br />
  5. 5. Generic DAO & Business Services<br />HadesDao<br />TESTED<br />Generic<br />Tested<br />Extendable<br />« extends »<br />GenericDao<br />GenericService<br />Specific<br />Testable<br />Customized<br />« extends »<br />« extends »<br />myDao<br />myService<br />
  6. 6. Generic DAO & Business Services<br />Provides…<br />CRUD methods (Create, Retrieve, Update, Delete)<br />Allows…<br />Save time (↘ copy-paste-adjust) on technical layers<br />Improve efficiency on the development of business layers<br />
  7. 7. Basic Example<br />How to… obtain a complete DAO layer for my POJO?<br />@Named("plopDao")<br />publicclass PlopJpaDao extends GenericJpaDao<Plop> implements PlopDao {<br />// Nothing<br />}<br />What else ?<br />
  8. 8. DAO & Business Services stack<br />Out of the box configuration<br />Identity manager<br />Multi-modules JPA entities scanning<br />Generic DAO & ServicesGeneric tests<br />Embeded database<br />JSR 303 Bean validation<br />Validator<br />1.2<br />Dependency injection<br />Generic DAO<br />Hades 2<br />3<br />3.5<br />Build system<br />3<br />JPA2 Persistenceengine<br />
  9. 9. Generic REST Web Services<br />Provides…<br />Generic methods to access business services<br />XML and JSON objects serialization<br />Allows…<br />Easily build applications REST-based architecture<br />GenericController<br />« extends »<br />myController<br />
  10. 10. Basic Example<br />How to… retrieve a persisted object in database ?<br />@GET<br />@Path("/{id}")<br />@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})<br />public Response getResource(@PathParam("id") ID id) {<br /> T entity = this.service.findById(id);<br />if(entity == null) {<br />return Response.status(Status.NOT_FOUND).build();<br /> }<br />return Response.ok(entity).build();<br />}<br />
  11. 11. Webservices stack<br />JSON Serialization<br />OAuth2 based security<br />Jackson 1.5<br />7.1<br />Run/Debug/Tests web application<br />Generic webservices Generic tests<br />JAX-RS REST Webservices<br />Project templates (archetypes)<br />Jersey 1.2<br />
  12. 12. Generic Tests<br />Provides<br />Generic methods to test your DAO, Business services and Webservices<br />Better protection against side effects caused by code changes<br />Allows<br />Focus on testing your project functionnalities<br />
  13. 13. Basic Example<br />How to… entirely test my DAO layer ?<br />publicclass PlopDaoTest extends AbstractDaoTest<Plop, PlopDao> {<br /> @Inject<br /> @Named("plopDao")<br />publicvoid setResourceDao(PlopDao resourceDao) {<br /> super.setResourceDao(resourceDao);<br /> }<br />}<br />
  14. 14. Use case 1 : RESThub + MVC Framework<br /> Tapestry5 website<br />Webservices<br />Server side<br />DAO and Services<br />
  15. 15. Use case 2 : RESThub full stack<br />JavaScript stackbasedWebsite<br />Client side<br />Webservices<br />Server side<br />DAOandServices<br />
  16. 16. Javascript Stack for RIA WebApps<br />Provides…<br />Script loader<br />Route manager<br />Templating language<br />Allows…<br />Use the latest web technologies consistently<br />Create lightweight RIA WebApps based on jQuery<br />Reduce traffic and server load<br />
  17. 17. Wellknownwebapp software design<br />Web browser<br />Reloading page for each action<br />Dynamic pages<br />Application server<br />SOAP proxytoJSON<br />HTTP server<br />Images<br />SOAPWeb Services<br />MVC framework<br />based Web GUI<br />session<br />CSS<br />Business Services<br />Webservice <br />SOAP<br />Javascript<br />DAO<br />
  18. 18. RESThub based webapp software design<br />Web browser<br />Changing the state of one widget on each action<br />Script loader<br />HTML 5 based session<br />MVC Framework <br />HTTP credentials<br />JSON/XML Data<br />Static pages<br />Application server<br />HTTP server<br />OtherRESTWebservices<br />Images<br />REST Web Services<br />CSS<br />Business Services<br />Javascript<br />DAO<br />HTML<br />
  19. 19. JavaScript stack<br />JavaScript library<br />1.4<br />Client side templating<br />JavaScript stack core<br />RESThub controller<br />JavaScript loading on route event<br />Route & session manager<br />Sammy<br />WADL explorer jQuery plugin<br />Script loader<br />JavaScript compressor<br />
  20. 20. Consequences on the architecture<br />Server is stateless<br />Can change just a small part of the page<br />Each part is independent (jQuery widget)<br />URL are semantic (example.com/product/list)<br />Client is statefull<br />Recent browser provides « session storage »<br />Each widget should knows his status<br />Manage the reloading of the page (F5)<br />
  21. 21. RESThub on hostingside<br />Clear separation between static and dynamic<br />Static: interface HTML5, JS, CSS<br />Dynamic: stateless secure webservices<br />Out of the box caching compliancy<br />Even when pages are user-customized<br />More operations are computed on client side<br />Better scalability thanks to stateless servers<br />
  22. 22. Security based on OAuth2<br />OAuth 2.0 basedauthentication<br />Work in progress IETF standard<br />Tokenbased<br />Used on Facebook and Twitter<br />Maybenext version of OpenIDwill use ittoo<br />Different profiles<br />User Agent profile<br />Webserver profile<br />Single Sign On<br />
  23. 23. OAuth2 use case<br />
  24. 24. Current flow<br />
  25. 25. Demos<br />Bookingdemo<br />Hotelbooking Web application<br />Hotelsearchengine<br />Consult & cancel bookings<br />Roundtabledemo<br />Doodlelike<br />Pollsearchengine<br />Dev console<br />
  26. 26. RESThub sample : Roundtable<br />
  27. 27. RESThub sample : Booking<br />
  28. 28. JavaScript<br />HTML<br />Route 1<br />Controller A<br />View A<br />Route 2<br />Controller B<br />View B<br />Route 3<br />Controller C<br />View C<br />URL<br />Sammy<br />Client side<br />Route 4<br />Controller D<br />View D<br />Controller E<br />View E<br />Route 5<br />Resthub controller<br />Events<br />Web services<br />Business services<br />Server side<br />DAO<br />DB<br />
  29. 29. Booking example (2)<br />booking/book.js<br />mode=edit<br />hotel/view.js<br />click(proceed)<br />booking/edit.js<br />booking/book.js<br />booking/book.js<br />mode=view<br />mode=edit<br />hotel/view.js<br />click(revise)<br />booking/view.js<br />click(confirm)<br />resthub.controller.js<br />Ajax request<br />home.js<br />

×