Join the DZone community and get the full member experience.Join For Free
A variety of considerations motivated use of the servlet concept, inspired by Java servlets. Reading through the quick-start guide, you will see that with the special features of JS Servlets, Achieve is very easy to use. But no one should be held back by tool limitations. Ease of use is a feature, not a limiting characteristic. The JS Servlet Context object, along with full access to Node.js and all the node modules that exist provides a path to a complete professional experience. Finally, early experience with Achieve makes it easier to introduce Java Servlets in a later course.
Real Developers Don't Need Unnecessary Complexity!
As work proceeded on Achieve, it became clear that the implementation was efficient enough for production. In addition, its basic features would be helpful to developers as well as students.
Achieve leaves application components loaded in memory as would be expected in production, but automatically reloads them when the code has been changed.
Achieve delivers error messages for display in the browser or browser console in the same form as errors in browser code, allowing one point of focus during development and test.
Achieve can handle the entire process of returning a response handed back to it through the servlet's return statement.
Achieve's default is utf-8 plain text, but you can change the MIME type and encoding (in fact, set any header) and still use the servlet return statement, allowing Achieve to finish the response.
You can set the application folder to any directory you have access to (including network directories) and set a subdirectory for the root application.
You can take complete control, as in any Node.js application, via access to the request and response in the servlet's Context object.
You can list the MIME types currently supported by Achieve and add other MIME types as needed.
Achieve supports browser caching (ETags) and compression (gzip, deflate).
You can build backend applications with Achieve in combination with other node modules.
A Separate Servlet Container!
JS Servlets alone can, in some circumstances, be a good choice for running microservices. Module servlets.js is the servlet portion of Achieve. It is Achieve without the static content server code. Although this may increase speed when speed is critical, the following should be considered when making a choice.
Because servlets.js is the servlet support portion of Achieve, you can develop using Achieve and switch to servlets.js in production.
Achieve allows microservice developers to work independently through unit testing, leaving integration for a time when other components are well developed. Triggering backend processes through your browser is easy to do and the way Achieve delivers error messages to the browser can help you debug. This simplifies the development process by allowing focus on one thing at a time. You can easily develop monitoring tools for your microservices with the browser as the GUI. Achieve runs through the serve vs. run decision quite efficiently. If you really feel the need to trim microseconds through coding, you probably need a faster computer.
Opinions expressed by DZone contributors are their own.