Well, I know that there are similar threads, but I think this is one thing. First, I come from the world of C ++ desktop development, so naked with me if I don't get all the terminology.
The application that I am developing will "respond", make asynchronous communication, and transmit a lot of JSON back and forth.
I need a Java MVC WEB environment that supports
1) Minimum amount of BLOAT and "backstage". There is always a trade-off between infrastructure functionality and complexity in any infrastructure. But when the time comes, when I am faced with a problem and must “fight with the framework” (and this time always comes), I want this to be an honest battle. Minimizing the size of the frame increases the likelihood of a fair fight.
2) Native support for RESTFUL . That is, route html verbs and perform content negotiation.
3) Simple support for JSON processing . Using an arbitrary json processor of my choice, i.e. Jackson or gson etc.
4) Simple sustainability support , for example. Jpa etc
5) Some template systems , for example. freemarker, speed etc
6) Native role-based authentication / authorization system with security support OR Spring Integration with Security
All of the above should be integrated into the structure. Not in some third-party user module that dismisses when a new version of the framework arrives.
I sat down for a day and experimented and found the following candidates
Spring MVC 3
1) To get the “Hello World” example in the preface and run it in spring MVC 3, I need the following banks:
- org.springframework.beans-3.1.0.RELEASE.jar
- org.springframework.expression-3.1.0.RELEASE.jar
- org.springframework.asm-3.1.0.RELEASE.jar
- org.springframework.context-3.1.0.RELEASE.jar
- org.springframework.core-3.1.0.RELEASE.jar
- org.springframework.web-3.1.0.RELEASE.jar
- org.springframework.web.servlet-3.1.0.RELEASE.jar
And finally, some definitions in the xml file, "dispatcher-servlet.xml". I don't know if this explains BLOAT or too much behind the scenes. But that does not give me a warm and fuzzy feeling that I feel a little controlled.
2) spring 3 supports this and from the examples , I saw that it does not look too nasty
3) It is supported, but from the link in (2) it seems that json processing is limited to using the jackson library. At least if you want to use magical annotations to harmonize content.
Quote:
"Under the covers, spring MVC delegates the HttpMessageConverter to serialize. In this case, spring MVC calls the MappingJacksonHttpMessageConverter built on the Jackson JSON processor. This implementation is activated automatically when you use the mvc: annotation configuration item with Jackson present in your class path. "
Warning bit for me. I would like to have clear programmatic control over which JSON processor I use. Maybe I missed something. This qualifies as unwanted “backstage magic” in my book
4) Yep
5) Yep
6) Yes
Play framework
1) Version 1.2 weighed 88.5 MB on my disk. It does not start in the servlet container, so getting the hello world example and working was easy peasy compared to spring, where even figuring out which boxes I needed were hidden in secret. Obviously, a lot of things are happening behind the scenes in the game. I think all I can hope for is that he does not do more than necessary. And that architecture is reasonable. But when will I ever struggle with the carcass, will I be dead upon arrival? Who knows...
2) Yes, and it is so elegant. Thumbs up.
3) Yes, but it uses gson under covers. Again, why can't I control this programmatically? Fortunately, you can pass an arbitrary serializer to gson to override the default value. And I think this parameter displays the second parameter of the renderJSON () function. So the games go with half a finger up.
4) Yes. Has a JPA module
5) Yes. Uses groovy. Fine.
6) A combination of secure modules and deadbolt modules should be possible. I don't know how well it combines with spring security. I do not see the built-in support for password encryption and the like. And I can’t imagine how difficult (if possible) it would be to integrate with spring protection. I don’t know if it will be more convenient to deploy sensitive data and rely on the game! security framework. It was probably necessary to build something on top of it.
Restlet
Maybe a special candidate that he sold to use for "hectic web services." But for my points (1) - (6) and my type of application, where most of the user interaction is asynchronous, it seems to be suitable. I can run it on static resources or dynamically generated content and spit out any type of content.
1) Restlet 1.1.1 is about 54 MB. He looked at the welcome example of the world. I liked the lack of XML files. And just like playing, it has its own server (berth connectors). The greeting example was very clean and light.
2) Yes, and the approach is very "software"
3) Yes, but this only seems to be via the jackson extension module . Given the programmatic nature of this structure, it seems likely that there are other options, but I have not found anything in the documentation or on user group forums.
4) Describes himself as an "agnostic of resistance." OK, I think. But I want to persevere and not reinvent the plumbing myself. Or at least I want to show a little that this can be done with some effort. There is a third-party jpa module, but it is built on restlet 1.0. Restlet has a spring module, although maybe I can integrate with spring persistance stuff ...
5) Yes, there is a freemarker extension
6) There is a proprietary scheme for this. A fist look, and not as "rich" as spring security. Again, maybe I can integrate?
ESSENCE
Spring MVC 3 . Supports all requirements, with the possible exception of (1). My only concern is that it seems complicated, and I get a vague, unpleasant feeling of uncontrollability. I really don't want to get stuck in the structure later, as my application grows.
Play : A very pleasant experience. Even fun. If only the security scheme was more advanced or I could at least integrate with spring protection (and find documentation on how to do this)
Restlet For some reason, this circuit resonated with me. The programmatic approach evokes a sense of control. But if I can’t persevere in some simple way, then it won’t . I can not understand why this is not built-in. Doesn't everyone need this?
- What do people who used any of the above structures say?
- Are my observations accurate?
- Didn't I leave the framework that should be here?
- Alternatives?
Greetings