Upload
kent-chen
View
40
Download
0
Embed Size (px)
Citation preview
Introduction to Srb4jKent Chen , 14/July/2016
Contents• What is it ?• Features• Technologies• Links
What is it ?• Srb4j = Simple RESTFul Backend for Java
• Code generation with Maven archetype• Your own maven artifact Id• Your own package name
• Batteries include. • Authentication• Persistence• More…
Features• Proven data structure for RESTFul API• Registration + login • Social account login • Password resetting + random code login• API document • Back office web portal
Feature – API Data Structure• “Response” structure for RESTFul API• Limited usage of Http Status Codes • Error code• Error description for User• Error description facilitating developer’s troubleshooting• Data
Features - Authentication• Registration/login - OAuth2 password flow • Access token• Refresh token
• Social account login• Google• Facebook• Allow for new social site• Support Html , Mobile and Desktop clients at the same time
• Password reset
• Random code login
Swagger Integration• API document generated as a Servlet• Example: https://srb4jdemo.chenjianjx.com/fo-rest-doc
• Client stub generation
Back Office Web Portal• Login/Logout
• Enforce code structure for back office
• Example: https://srb4jdemo.chenjianjx.com/bo/portal
Technologies• Popular J2EE Stack• JAX-RS • Spring • MyBatis • MySQL
• AOP: Bean Validation, user input trimming, timestamp update• Modularized structure design• Application Layer User Oriented• Biz Layer = Neutral Services• Maven artifact as component• Ready for distribution (Microservice)• Be Pragmatic: Not too many components
Webapp
Front-End Web Service Client Back-Office User’s Browser
Web Layer
Front-End Web Services Back-Office Controllers
Biz Layer
Application Layer
Front-End Managers Back-Office Managers
Neutral Services
Internet
Maven Components
Try it now !• Quick Start• https://github.com/chenjianjx/srb4j#quick-start-for-backend-developers
• Demos• A sample backend: https://srb4jdemo.chenjianjx.com/• Demo Html SPA Client: http://srb4jclient.chenjianjx.com:8000/• Demo Android Client: https://github.com/chenjianjx/Srb4jAndroidClient• Demo Desktop Client: https://github.com/chenjianjx/srb4j-desktop-
client
• Documents• All-in-one document: https://github.com/chenjianjx/srb4j• Philosophy of Srb4j’s modularization:
http://www.chenjianjx.com/myblog/entry/layering-in-java-webapps-final
The End