I’ve been doing research on this for the past 2, almost 3 days now. I feel like I’ve googled everything under the sun on the matter (including these forums) and am almost all tutorialed-out. Before I go into any more details on the question I just want to give a quick overview of the scope and plan for the project to see what will suit it best:
-Large application, non-trivial
-50+ DB tables
-Large user base
-User management/authentication/sessions
-transactions
-security
-MVP (as per GWT recommendation)
-focus on performance and scalability (naturally :), am using GWT after all)
-Prefer to stick with Java serverside
I’ve also read and watched all of the best practices on architecture for large applications (Google/GWT). In the last talk I could find on best architecture practices involving GWT was back in 2010 by Ray Ryan in which he states that they don’t think JavaBeans and property change events work terribly well so it’s better to use DTOs for the Model.
The 2 frameworks that came to the forefront in my searching were Seam and Spring.
Sticking with MVP, my domain would for the most part be a data service with a thick client. However, I would still like the serverside to have security and session capabilities since I’d like users to be able to keep state even if they don’t use cookies and they end up refreshing for example. I would also like to have an ORM like Hibernate to manage a lot of the transactional aspects. I’d like to still use RequestFactory and have really been considering Spring.
I guess I can narrow my question down to:
Considering the above, what would the recommended application stack be for a large GWT application, specifically for the serverside and integration with GWT?
This is my first project of this scale and the last thing I want to do is head down the wrong path on losing a lot of time and energy. Thanks a lot in advance for your help, I really just want to figure this out so I can get back to coding instead of googling the ends of the earth ;).
-Seth
I’ve also already looked at Best architecture for applications in GWT which I found might be the closest to this, but it didn’t really answer my question and I feel mine is a little more targeted with a more specific use case
I don’t have any experience with
Seam, however I am working on a relatively large project usingGWTon the frontend andSpringon the backend and so far it works really well (RequestFactory, JPA2/Hibernate, PostgreSQL). BTW you can also checkout JBoss EraiThe good thing about using
Springis, that adding new features is quite easy. For example I added support for openid authentication and all I had to do is define an additional dependency in maven and some additional lines in the configuration file and now authentication via google,facebook, twitter account works out of the box.This layered approach has a lot of advantages.
But if you really stick to the best practices of developing GWT apps (MVP, etc), you will end up with two more or less separate projects. This is a little bit different then when you would develop traditional Spring MVC/Web Flow apps where you have more or a less only one projects (btw: check out Thomas Broyer’s gwt maven archetypes which helps you come up with a good project structure).
In addtional to this when you use MVP on the client side your backend will actually only serve as a data service which feeds your GWT client with data. All the flow synchronization will be handled in your GWT app.
So you will probably not use many of the backends functionality (i.e. the MVC part of
Spring MVC).I use
RequestFactoryfor data communication between backend and frontend and forCRUDapplications this works really well (it also supported from Android btw).However if you want to support a more clients you might rather use a
Restlessapproach. Again by usingSpringon the backend it is relatively easy to addRestlesssupport to your app and there are a couple of 3rd partys libraries supporting restful services in GWT (RestyGWT, Restlet).Here are some thoughts on the development process:
maven. It makes it really easy to develop in teams and split up your projects in manageable units/modules (for example a GWT maven app can be split up in a frontend part (GWT), backend (Spring) part and a shared (comong DTO’s, etc) part.Spring. A relatively largeSpringapp can have a relatively large startup time. JRebel helps you to change classes in the backend without a reloading/restarting the application. It saves a lot of time.Spring Securityand they work fine for simple use cases however if you have complex use cases (for example filter a list of items based on ACL entries) this can be quite involved if you want to do it efficiently. On the other hand withSpringit is relatively easy to use another library (i.e. Apache Shiro). Futhermore you have to make sure that you display the correct controls on the frontend (i.e. no Edit button if the user doesn’t have edit permission, etc). With JSP that is easy because you create the UI (HTML page) on the backend. InGWTyou have to do it yourself.