Monday, March 10, 2014

A Comparison of Open Source Java Web App Frameworks: Spring vs Play!




In the old days, Java web programming was done with Java Web Servlets, and HTML was embedded inside of Java "servlet" code that was placed in "web containers" that interacted with actual servers. This is what servlet code looks like:



Click the sample code above to see a more full-blown example of the process.

Every single time servlet code changes, one needs to stop and start the server running the servlet. This doesn't sound like a big deal; after all, most coding workflows require recompilation and re-execution for every change we make.

As this StackOverflow answer says, Spring is a framework that primarily serves to "wire" components together.

Inspired by Ruby web application frameworks such as Rails and Sinatra, Play Framework differs from Spring in that it supports Scala development and it detects changes to files and automatically recompiles and restarts the server on those changes.

Packaging for distribution in both Play and Spring are both rather straightforward. Either run "play dist" for Play or "./gradlew build" for Spring.

Both Play and Spring support asynchronous programming with Comet WebSocket.



What does the Spring framework do? Should I use it? Why or why not? [closed]. (n.d.). java. Retrieved March 17, 2014, from http://programmers.stackexchange.com/a/92672/79516 Spring. (n.d.). Spring. Retrieved March 17, 2014, from http://spring.io/

No comments:

Post a Comment