Spring MVC or Web Flow for end-to-end web apps

Discussions

Web tier: servlets, JSP, Web frameworks: Spring MVC or Web Flow for end-to-end web apps

  1. Spring MVC or Web Flow for end-to-end web apps (4 messages)

    1. Has anyone used only Spring MVC (or Web Flow) for an end-to-end web application versus using it in combination with Struts, JSF, etc.

    2. Also, is using Spring-JDBC instead of Spring with a OR tool (e.g. Hibernate) is a clean//good solution?


    In summary, I'm wondering if using only Spring is a viable option for these requirements (of mine):

         WEB FRAMEWORK > BUSINESS OBJECTS (POJOs) > DAOs

    So, given the above, should/could I using Spring as:

         SPRING MVC > POJOs > HIBERNATE

    or even:

         SPRING MVC > POJOs > SPRING-JDBC


    Any help would be greatly appreciated.
  2. I've just finished a SpringMVC+Velocity+Hibernate project a week ago for a national competition. Personally, I like the smooth integration of Spring with Hibernate. When all the O-R mapping rules is set,I(btw, I did all the spring MVC job, one of my partners did all the Hibernate and db interacting) and my Hibernate partner were able to started work at the same time. Personally speaking, I think it did saved a lot time on development, comparing to the JDBC way I used to do.
    Besides, Hibernate is really versatile and scalable. It offered some handy functions. For instance, Hibernate can return the value of an auto-incremental column(such as an id column) after a new record is inserted without visiting the db another time. It's useful in our project.
    Well, it's my feeling about Hibernate. Hope it's of some help. Good luck
  3. Thanks, that helps.

    By the way, I'm getting to post this in a new Post but perhaps you can help, as well.

    If I have a CRUD type screen (Add, Edit, Delete), should I have one controller for the entire screen or one controller per button/functionality (i.e. Add, Edit, Delete)?

    Thanks in advance.
  4. Since the number of parameters varies in CRUD operation(you need only an Id to delete a record, but you have to take more parameters for insert operation.), it seems wise to write separate controllers for different. However, you may need something in common to be done first before CRUD. For instance, I'm Chinese, so I need to analyze and transfer the page coding each time before I get access to database. Here I suggest a Spring MultiActionController. It allows you to map different links to different Handlers in One Controller. You can config the mapping in application-context.xml by setting its method name resolver. You can check the this package: org.springframework.web.servlet.mvc.multiaction out. I found something useful and interesting here.
         
    Another option is to use AbstractCommandController. The reason for this controller is the nature of Hibernate. Hibernate maps infos to an object. So you can let the AbstractCommandController input/ouput the object and let hibernate do the all object<->Data rowset things for you.

    Glad to be helpful. :)
  5. Thanks; that helps tremendously.