PDA

View Full Version : help choosing other frameworks to use with spring on new project


vincent_disco
Feb 7th, 2006, 10:45 PM
hello all,

i have spent many and many an hour searching the internet for information regarding what other frameworks i can use with spring for added features.

first i will explain necessary requirements:

the most important feature is to handle large uploads and downloads. it will be a single zip-like compressed file containing images and an xml file.
user login (i have this code using spring controllers/validators/beans from a previous project, but would be willing to use different framework) will also exist.
mysql database in the backend. therefore, there will be many different forms which make queries to the database. (already have this set up using spring beans/controllers/validators).
allow the user to change "themes", although my team is considered using all css to handle this. got any arguments i can give them against this? or anything that would be better?
the model must come from the database and be injected into the view from beans. aside:would i still use spring beans if i use recommended frameworks?
create online photo album administration. any ideas on how to allow reordering of images? preferably drag and drop of thumbnails (similar to an app like iphoto on macosx), but a list of filenames with scrollbar would suffice. selecting multiple images or list items necessary. if able to set up similar to iphoto, considering using ajax to also fill form input textfield for filename/title/description when a thumbnail or filename is selected from list.
would like to detect any change to form input textfields and automatically save changes as if submit button pressed but refreshed to the same session form. an example would be a celsius/f degree converted that output a value below the form input textbox so to check the value 30, you would first see 3 translated, then after 0 was added, the translation would change.
drop down menus when hover over table cell....each cell being a link as well.


these are frameworks i want to use alongside spring. i am willing to use more than one if that means i will get all functionality. here is a quick overview of opinions i have generated using an algorithm in my brain that i am trying to reverse engineer: (please agree with or correct me)

struts: has good following, support, but is aged. newer frameworks out that learned from its mistakes. has ability to use tiles...aside:does this mean you can inject views into table cells? overall, use another framework for a new project.

jsf/myfaces: do i use either of these for my ui? if i do choose to use one of them, which should i use? what necessary functionality could one of them fulfill? also, what cool stuff can you do with them? i was not able to find that much very current tutorials on them also....which worries me about their current support. jsf WILL be big, but is it the best out right now?

tapestry: most of the stuff i have found hails 4.0 as having many unique features. but again, what necessary functionality could it fulfill and what cool stuff can it do? does it have an equivalent to struts tiles? it sounds cutting-edge, but still has somewhat limited support and following. may not be around in a year or few?

jsp: its the obvious choice. do i have others? i got the impression jsf does not work smoothly with it. opinions?

dwr: ajax has its obvious advantage to only update a portion of the screen instead of refreshing the whole thing. it seems you could do a similar thing with struts tiles? before dwr, ajax/java integration sounded pretty tedious, but this has some good reviews. can anyone comment on the ease-of-use and learning curve? also on stability?

lastly, anyone ever integrated php with java and spring?

if you've made it this far, please reply on anything you are knowledgable about. as its my duty on the team to research alternate frameworks for their ease-of-use functionality. my deadline is coming close, so i figure id take in any other opinions than ive been able to find on google.

thanks in advance,
vincent disco

Colin Yates
Feb 8th, 2006, 05:48 AM
the most important feature is to handle large uploads and downloads. it will be a single zip-like compressed file containing images and an xml file.

Spring MVC handles this out of the box. The latest version actually uses the commons multipart library (IIRC).


user login (i have this code using spring controllers/validators/beans from a previous project, but would be willing to use different framework) will also exist.

Reuse if you wish. I presume it is done in Filters (not Servlets)? Reusing *Servlets* is difficult, but reusing filters is trivial. Alternatively you could look at Acegi.


mysql database in the backend. therefore, there will be many different forms which make queries to the database. (already have this set up using spring beans/controllers/validators).

Fine; look at the DAO abstractions (Hibernate, JDBC etc.).


allow the user to change "themes", although my team is considered using all css to handle this. got any arguments i can give them against this? or anything that would be better?

CSS is black magic, however, for user customisable web apps it is fairly nice. You could use tiles (Struts sub project) as well, not sure how much themability (is that a word?) it gives you though.


the model must come from the database and be injected into the view from beans. aside:would i still use spring beans if i use recommended frameworks?

There are no such things as "Spring beans", simply POJOs. Command/formBackingObjects are not dependant upon Spring; they are POJOs.


create online photo album administration. any ideas on how to allow reordering of images? preferably drag and drop of thumbnails (similar to an app like iphoto on macosx), but a list of filenames with scrollbar would suffice. selecting multiple images or list items necessary. if able to set up similar to iphoto, considering using ajax to also fill form input textfield for filename/title/description when a thumbnail or filename is selected from list.

Is this on a webapp, or rich client? For web apps there are lots of AJAX solutions; but this isn't really a Spring related question. Using Spring won't prevent you from this..

would like to detect any change to form input textfields and automatically save changes as if submit button pressed but refreshed to the same session form. an example would be a celsius/f degree converted that output a value below the form input textbox so to check the value 30, you would first see 3 translated, then after 0 was added, the translation would change.

Again; nothing in Spring will help/prevent you. Using javascript/AJAX would help you though.


drop down menus when hover over table cell....each cell being a link as well.

See above comment.


struts

I *much* prefer Spring MVC over Struts; but you have to remember that Spring MVC is just a component that utilises Spring. You can use Struts with Spring, or even (which I am doing) just use tiles (and Spring MVC).


jsf/myfaces: do i use either of these for my ui? if i do choose to use one of them, which should i use? what necessary functionality could one of them fulfill? also, what cool stuff can you do with them? i was not able to find that much very current tutorials on them also....which worries me about their current support. jsf WILL be big, but is it the best out right now?

I have never used JSF; but my colleagues who have, have all aged very quickly and are frequently found in corners crying like big babies :)


tapestry: most of the stuff i have found hails 4.0 as having many unique features. but again, what necessary functionality could it fulfill and what cool stuff can it do? does it have an equivalent to struts tiles? it sounds cutting-edge, but still has somewhat limited support and following. may not be around in a year or few?

No idea, sorry.


jsp: its the obvious choice. do i have others? i got the impression jsf does not work smoothly with it. opinions?

Not sure about JSF/JSP integration; but yes, there are many other alternatives. Remember, JSP is just a rendering framework. You provide the model and the template (.jsp) and it will render the view. Other rendering frameworks I have successfully used with Spring (and which Spring supports) are Velocity, XML/XSLT (never again) and FreeMarker.

The advantage of Velocity/XML/FreeMarker is that they do not require a heavy environment in which to execute, and can easily be unit tested. JSPs cannot.


dwr: ajax has its obvious advantage to only update a portion of the screen instead of refreshing the whole thing. it seems you could do a similar thing with struts tiles? before dwr, ajax/java integration sounded pretty tedious, but this has some good reviews. can anyone comment on the ease-of-use and learning curve? also on stability?

I don't think tiles allows you to *dynamically* update the screen. Tiles (as I understand it) disects the screen into a number of sections (header, menu, footer etc.) and allows you to specify different views for each section, but this is only used for rendering. Once it has gone to the client; it is out of tiles hands. DWR is a very nice library; but there are lots of other AJAX libraries. Again, nothing in Spring will help/hinder you.


lastly, anyone ever integrated php with java and spring?

No idea. Why?

One of the key design goals (I expect) of Spring was to be extensible. It *isn't* a container in the sense of an EJB, it is (at it's heart) an implementation of an IOC container which also has excellent support for a large number of 2rd parties (connection pools, EJBs (walk away), JNDI, transaction managers etc.).

Spring MVC (and Spring Web Flow) is an MVC implementation written on top of Spring.

I have used Spring and hibernate (which you might like ;)) in all of the web projects for the past 2-3 years without any problems and it has always been sufficient. If I needed to customise it, it is so granular and decoupled; it is trivial.

Have a look here: http://forum.springframework.org/showthread.php?t=22047&highlight=extensibility for some more information about Spring v Struts.

So yes; I would heartily recommend you use Spring; your code will be nicer, cleaner, more maintainable and robust. If Spring MVC or Spring Web Flow don't fit your needs; please; still consider the Spring container :)

Keep asking those questions ;)

Colin Yates
Feb 8th, 2006, 05:51 AM
BTW; forgot to mention that the current web app uses the following technologies:

Spring, Spring MVC, Spring Web Flow, Hibernate, JSP, freeMarker (yes, both), tiles and Prototype (AJAX library).

All of these were handled by Spring without *any* code; merely configuration. Of course; I have written some code; but integrating the toolkits required no code.