Lightweight Java web framework - specific requirements -
Lightweight Java web framework - specific requirements -
the first time encountered e.g. ruby's sinatra framework or php's zend framework, wondered if there adequate in java, seems bloated here. although there myriads of frameworks around, have found none far deemed perfect kind of architecture implement.
i wanted design web application heavy on javascript of application logic implemented on client, java back-end more or less serve info store or perform complex computations.
i did through related questions here couldn't find perfect answer, each of suggested solutions had quirk not match requirements.
so looking for, open source framework next features:
convention on configuration no xml configuration except web.xml pure java (no scala, no groovy, ...) natural rest-style urls such /news/2011/july (no .do, no .jsp, ...) rest-aware it shouldn't forcefulness me deploy on application server (e.g. ejb should optional) session back upwards nice not mandatory code generation in rails awesome not mandatory minimum of dependencies, little in overall size mvc nice, i'd able take m part, take persistence libraries on own (no bundling). no automatically generated code view, neither html, javascript, nor css an integrated template language nice, should minimalistic (simple command flow, access template variables) layout back upwards (i.e. able specify mutual template similar views) free selection of javascript framework viewsbasically mean mvc framework routing me , offers template back upwards views, rest modular, no magic. there minimalistic framework provide (or @ to the lowest degree modular plenty configured way)?
how play framework?
convention on configuration
play has few configuration files. of construction convention. illustration basic construction goes this:
| +---/app - executable artifacts go here (java files, conf files , view templates). | | | +---/model - model java classes. | | | +---/view - view templates. | | | +---/controller - controller classes | |---/conf - contains configuration files application. contains application configuration , routing table. | |---/lib - libraries appliaction needs. added automatically classpath. | |---/log | |---/public - public stuff static assets server gives straight | |---/test | |---/tmp - temporarily compiled .class files here no xml configuration except web.xml
play has no xml configuration, including no web.xml. has routing file instead. see illustration below uses routing.
pure java (no scala, no groovy, ...)
it's pure java, can utilize scala or groovy through plugin.
natural rest-style urls such /news/2011/july (no .do, no .jsp, ...) rest-awarefrom site: play real "share nothing" system. ready rest, scaled running multiple instances of same application on several servers.
in fact routing in rest manner quite easy:
# play 'routes' configuration file… # method url path controller / application.index /about application.about post /item item.additem /item/{id} item.getitem /item/{id}.pdf item.getitempdf it's not hard guess goes 1 time used play bit.
it shouldn't forcefulness me deploy on application server (e.g. ejb should optional)it doesn't. in fact deploy saving files. ejb optional , .war, .ear , other forms of deployment.
code generation in rails awesome not mandatory
i don't think much code generation i'm not 100% on that. automatically create required folders , instantiate basic illustration page. don't know if rails generates else...
mvc nice, but - i'd able take m part, take persistence libraries on own (no bundling). - no automatically generated code view, neither html, javascript, nor css - integrated template language nice, should minimalistic (simple command flow,
see mvc in play
think minor counter point. play models must utilize jpa or extend model class comes play. see play framework-model more info. it doesn't generate html though can utilize template language within.html,.css,.js , other files create dynamic pages. i has inbuilt template language based on groovy template language e.g.
you have ${emails.unread ?: 'no'} ${emails.unread?.pluralize('email')} !other pros:
it's quite fun programm in. did mention hotswap allows redeploy app saving source files? great error logs.cons:
it's 51mb not sure if qualifies lightweight :/ java frameworks
Comments
Post a Comment