java - Web Services vs Servlets -
i have whole business logic along integration database written in java. have 2 options: either can write restful webservice access or can follow standard servlet approach access ui... advantages , disadvantages of both?
in fact, try compare things different.
rest style of architecture targetted distributed systems in context of web technologies. whereas doesnt depend on http protocol, latter particularly suitable implement these concepts. implementing restful service http means leverage features , use them right thing. principles can implemented different technologies , in java different frameworks.
this link provide insights rest concepts: https://templth.wordpress.com/2014/12/15/designing-a-web-api/.
servlets correspond api , container handle web applications. container responsible of transport layer , let focus on way handle http requests , create responses. free them build application , use http want. of time framework used on top of them implement applications. can implement restful applications raw servlets if want bit of additional work.
there several frameworks that:
- restlet (http://restlet.com/projects/restlet-framework/) allows create , / or consume restful services in java. can executed in standalone application or within servlet container.
- spring mvc provides support configure web applications within lightweight container dependency injection. framework provides rest support.
hope helps you, thierry
Comments
Post a Comment