3 ms·
The approach in the Java world for many years have been to implement Services (or Repository if it doesn't need a complex operations) and wrap them via facade p
by hello_moto 15y ago
The approach in the Java world for many years have been to implement Services (or Repository if it doesn't need a complex operations) and wrap them via facade pattern by utilizing:
- JAX-RS (RESTful)
- JAX-WS (WebService)
- MVC (view-based web-app)
And in contrast to what people believe, you don't need to write tons of code and still get full re-usability from the Services/Repositories layer.
On the front-end, you have a choice of:
- GWT for thick-client via RPC (return serialized Java object) or AJAX (return JSON)
- JSP, JSF, any templating available
- Mobile, Desktop, anything
- rudy750 15y agoCan you tell me more? I am currently looking for a solution. Looking at jersery. What are you working with?
- hello_moto 15y agoI use jersey (provided by glassfish).
- devs1010 15y agolook at spring roo, its a more modern approach and uses active record rather than the service layers / repositories, it makes generating json api's really simple
- hello_moto 15y agoA few points: 1) Spring Roo is not necessarily a more modern approach. It's more similar to Rails. 2) JAX-RS is more like Sinatra than Rails. Generating JSON api is already simple in JAX-RS. 3) Not everybody wants ActiveRecord http://www.braintreepayments.com/devblog/untangle-domain-and-persistence-logic-with-curator http://www.braintreepayments.com/devblog/untangle-domain-and... https://github.com/braintree/curator#readme https://github.com/braintree/curator#readme 4) JAX-RS comes with standard Java EE (moot point) 5) You can re-use your Servlet knowledge with JAX-RS to some extend (Filter, setting up web.xml, etc) Not to take anything away from Spring Roo which is a wonderful project.