Help With Framework Choices

Vaadin Forum,

I am totally in love with Vaadin. I got it running on my tomcat instance and am very impressed with the ease of use. Here is my situation:

  1. Our company is deciding what application stack to use.
  2. We’re trying out everything from seam to RoR to Spring MVC, and more.
  3. We are only allowing a full application stack to be considered.

The problem I’m having is I’m not figuring out what application stack to use with Vaadin. I researched using seam and it looks clumsy since seam is tied to RichFaces or ICEFaces. From reading this forum, it looks like Spring MVC may be the way to go.

I’m curious if there are other choices.

I’m not interested in LifeRay or Grails. I’d like to stay Java. I’ve checked into integrating with seam and Struts 2, and Spring MVC a little bit but nothing looks real convincing yet.

Thanks for any and all help.

Hi Eric,
Just joined the forum and so apologies for jumping in, but you might be interested to know that I’ve kicked off a sourceforge project aimed at bringing together Vaadin and my open source full-stack framework, Naked Objects. Sami Ekblad (of IT Mill) has indicated his interest in devoting a little time on this; we see there’s potentially a lot of synergy between the two frameworks, with NO providing the full stack you’re talking about (plus a bunch of other stuff).

It’s very early days and so if your timescales are tight then you probably should press on regardless; but you might want to keep a tab on our progress; the SF website is
here
. (Or, you might be interested in getting more closely involved).

Cheers
Dan

PS: if Naked Objects is a new name to you, there’s are some
screencasts
at my
blog
as a starter.

Sure, I’ll keep a watch on NO! Unfortunately, I will probably need to integrate with a stack that has been used for awhile. I would love to try the stack out though. Who knows, if it is beyond awesome I might be able to convince the rest of the developers to consider it. Thanks.

Hi, and welcome.

As you may see, Vaadin is completely a UI Layer for the application. It does not have anything to do with making your business logic. You can use about any other framework along with Vaadin as everything made in Java is applicable to the back-end of Vaadin. There has been several discussions about Spring+Vaadin already. Search on the forum and on google and you’ll find them. One of our community members has also implemented a full-blown Spring+Vaadin application skeleton and been kind enough to share it with the whole world. I guess you could have some use out of it. You’ll find it
here
.

Best of luck, and welcome!

Well, NO itself has been around for a good while; what’s just kicking off is the development of a new generic viewer using Vaadin. But NO isn’t widely used, and I do appreciate that in making these strategic decisions that’s an important factor to consider.

Do try out NO, though, even if just for prototyping. You’ll end up with a pojo-based domain model that you can then deploy using a custom Vaadin UI and a regular Spring/Hibernate stack for the back-end.

Cheers

Dan

consultant, trainer, author - developing enterprise applications
blog: http://danhaywood.com
twitter: http://twitter.com/dkhaywood
linkedin: http://www.linkedin.com/in/dkhaywood
books: “Domain Driven Design using Naked Objects”, http://pragprog.com/titles/dhnako

Thanks for the link!! I did read through all the posts on Vaadin+Spring before posting. I didn’t find the one in your respond for some reason. I’ll give the link a shot sometime today or tomorrow and expect to post back with success. Thank you!

Nice idea on the prototyping, I’ll keep that in mind. Thank you.

I’m getting closer! I think I may still end up needing some help. After looking at http://dev.vaadin.com/browser/incubator/SpringApplication I realized I don’t have a clue about Spring so I did the following:

  1. I downloaded spring-framework-2.5.6-with-dependencies.zip
  2. Unzipped a fresh copy of apache-tomcat-6.0.20
  3. Started going through the step by step tutorial for building a Spring app from scratch.

I was amazed by the tutorial. For those who have never played with Spring, the tutorial is found in:

/spring-framework-2.5.6/docs/MVC-step-by-step/html_single/index.html


So, now I’m trying to figure out…can I get Vaadin to work with this setup or do I need to start over and use the one that is found at http://dev.vaadin.com/browser/incubator/SpringApplication?

I’ll probably end up attempting both, but I’m so in love with the quality of the experience that I had with the Spring tutorial that I want to plug Vaadin into that first.
If anyone has advice on what I need to do, let me know. In the meantime, I’ll be trying to compare my setup with what is found at http://dev.vaadin.com/browser/incubator/SpringApplication and the instructions at http://vaadin.com/wiki/-/wiki/Main/Spring%20Integration?p_r_p_185834411_title=Spring%20Integration
. I plan on using the annotations approach to get to the bean if possible.

Any tips are greatly appreciated. Below are some brief notes on the resulting setup from going through the Spring tutorial:

  1. Setup structure:
- build.properties - build.xml - db - src --- springapp ----- domain ----- repository ----- service ----- web - test - war --- WEB-INF ----- web.xml ----- springapp-servlet.xml ----- applicationContext.xml ----- classes ----- jsp ----- lib ------- aspectjweaver.jar ------- commons-dbcp.jar ------- commons-logging.jar ------- commons-pool.jar ------- hsqldb.jar ------- jstl.jar ------- junit-3.8.2.jar ------- spring-test.jar ------- spring-webmvc.jar ------- spring.jar ------- standard.jar ---- tld
  1. src/springapp/domain classes are simple POJOs.

  2. src/springapp/repository classes are DAO classes that use org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport

  3. src/springapp/service classes are simple Java classes that use the DAO/Model and are called from the controllers.

  4. src/springapp/web classes are controllers that use org.springframework.web.servlet.mvc.Controller, extend Controller, make calls to the service classes, handle the servlet request, return an instance of org.springframework.web.servlet.ModelAndView, and are configured in springapp-servlet.xml and applicationContext.xml.

  5. I’m expecting to add vaadin-6.1.4.jar to either WEB-INF/lib or to my tomcat/lib.

  6. Based on what I’m seeing in http://dev.vaadin.com/browser/incubator/SpringApplication I’m going to add a ui and util directory to my src/springapp. For the other directories, mappings from SpringApplication to my setup are: model=domain, servlet=web, service=service.


8. This is where I’ll probably need help: I’m going to attempt to translate the differences in SpringApplication/…/applicationContext.xml and web.xml to somehow work with my setup. This is the grey area to me. I was able to get Vaadin working with tomcat and basic servlets but I’m not sure what I’ll run into trying to get Vaadin working with a fresh install of Spring.

I’ve also attached my setup. Sorry for the long post but I’m way excited about all of this. Our current technology stack was developed in 1999. All we had back then were servlets. We currently persist our own data, are stuck with FreeMarker classic, compile with SQLJ, and have our own blasted “controller” classes using Java reflection. The stuff I’m seeing with Spring and Vaadin are seriously blowing my mind!! Seam is cool also and RoR also blows my mind (Ruby syntax/constructs alone), but I think Spring with Vaadin will continue to be a serious contender for our use. With RoR I’m also still not fully convinced about the performance of ActiveRecord.

I also apologize in advance if what I’m trying to do is not unique and has already been detailed in this forum. I tried reading through all the posts but I still get lost in what I read.

If this works, I’ll be able to have my developers do a fresh install of tomcat and Spring using the Spring step by step tutorial and then apply Vaadin. Please correct me if I’m wrong, but I think this is a good approach for a newbie to learn tomcat/Spring/Vaadin. So, here goes and thanks for any help!

BTW, had to remove the jars in war/WEB-INF/lib, attachment was too large. I added a readme to the lib in case anyone wants to get the jars and deploy this with tomcat. If you do, you will also need to edit the build.properties to find tomcat and you will also need to follow the spring tutorial to run the db. Personally, I think you learn so much more from going through the tutorial from scratch.
11128.gz (22.3 KB)

Take a look at Spring Roo (http://www.springsource.org/roo). SpringApplication project is made with it. I think that Spring tutorial is a bit outdated since Spring Roo is way to go nowadays.

Thank you! I’ll check it out sometime tonight or tomorrow.

Thanks for the tip on checking out Sping Roo! Here is a brief progress update:

  1. I got the sample tenminutes and wedding Roo applications running. This was also my first exposure to Maven and I’m quite amazed with it.

  2. I also got the SpringApplication running and deployed to Jetty as instructed in the readme. Just out of curiosity I decided to also try mvn compile tomcat:run. It worked! I’m not sure how tomcat was pulled (didn’t download it like Jetty) out of the air but it worked!

  3. I’m newbie on this, but I noticed that the target/tomcat/webapp directory had nothing in it. I was curious about this. I would have guessed that when deploying to tomcat that stuff would have been dumped into the webapp directory for tomcat but I’m sure I’m missing something.

So now what…

  1. My next goal is to analyze, file by file, the differences between the apps I’m making with Roo and the SpringApplication example so I can easily create new models and controllers and then plug in Vaadin into them. Am I on the right track? I don’t want to just copy the SpringApplication and modify it because I want to build projects with Roo. Let me know if I’m missing something.

If anyone has a any tips (has gone down this road) on the structural changes to allow Vaadin to work specifically with Roo let me know. Might be helpful, I might miss something.

After I have success I’ll post the steps in case anyone else is interested in this approach. If there is a better approach, please let me know. I could be wrong but this is pretty bleeding edge.

Tomcat is running in embedded mode when using tomcat:run command. More info
here
. Maybe tomcat:run-war does what you expect.

Unfortunately Vaadin does not have Spring Roo add-on but just copy SpringApplicationServlet, BaseApplication, ApplicationHelper and VaadinApplicationObjectSupport classes to your project. Then add servlet to web.xml. Finally make application class that extends BaseApplication and add Vaadin dependency to your project pom.xml. Spring controllers can’t handle Vaadin requests. Instead all requests are handled by servlet. Although you can mix these technologies so you can create some parts of your application with Spring MVC and others with Vaadin.

Thank you! I’ll try this soon and report back. I’m also trying Grails/Vaadin but I’m not sure if the development team will accept grails so this will also be a great help in case we go with roo. I’m fighting for Vaadin!!