What stack would you use for a new web Java project if you started today? [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this questionIf you were to start a brand new Java project today with the following requirements:
high scale (20k+ users)
you want to use something that is fairly mature (not changing dramatically) & wont be dead technology in 3 years
you want something very productive (no server restarts in dev, save the code and its automatically compiled and deployed), productivity and time to market are key.
some amount of AJAX on front end
no scrip开发者_开发技巧ting language (JRuby, Groovy, PHP etc.), it has to be Java
has to support i18n
What stack would you use & Why? (when I say stack, I mean, everything soup to nuts, so app server, mvc framework, bean framework, ORM framework, javascript framework, etc...)
I would consider using a Java EE 6 stack:
- GlassFish v3 as app server: not heavy, very productive during development (and GlassFish 3.1, to be released before the end of the year, will have Centralized Administration / Clustering and High Availability / State Replication)
- JQuery, JSF 2 (or Wicket) for the presentation
- CDI, EJB 3.1 (Lite?), JPA 2.0 (Hibernate 3.5+ or EclipseLink)
- Arquillian(1) with Weld SE and/or GlassFish Embedded for testing
(1) See also:
- Testing Java EE the JBoss way
- Arquillian 1.0.0 Alpha2 - Released
for a traditional java webapp, for your goals, I would go with stripes as an MVC framework as it's very easy to set up and get running, and it plays well with spring and hibernate, and has good ajax support.
in terms of productivity, eclipse dynamic web projects should solve your compile/deploy issues. I've always used it with tomcat, but it should work with jBoss also.
I personally would use tomcat, stripes (mvc), hibernate (orm), spring (if necessary), jQuery (js), and eclipse for development.
- Tapestry 5 & JQuery (Tapestry 5 has been designed to be future proof, does not require server restart and is super fast to develop with - components are lean- it also scales well)
- Spring for bean configuration (Tapestry supports annotation based Spring bean configuration)
- Hand crafted JDBC for relational model (because I don't like adding yet another code layer for ORM, and hand crafted can be better tuned)
- Lucene for indexes or data that does not need to be queried in a relational manner
- Tomcat (or Jetty if embedded) - both are reliable and well tested servers
I would go for:
- Oracle 11g database.
- JPA 2.0 ORM with EclipseLink.
- Glassfish v3 (at least until Oracle WebLogic becomes Java EE 6 compliant), providing any message queues, DB connection pools or whatever JCA resources you might need.
I wouldn't go for JSF... JSF 2.0 is much better than JSF 1.0, but still stinks in some areas. You will definitely hit a wall in scenarios which 'go against the JSF way' (or rather weren't catered for properly in JSF).
I would go for Spring 3.0 framework and Spring MVC with Spring Web Flow if you have some complex navigation you wish to have control on. This will also give you the option to have the web part on a separate server (such as Tomcat) if you wish, and invoke the EJBs hosted on Glassfish through IIOP, thus scaling up.
If you wish to have full control on the design of your pages, (maybe you intend to employ a web designer to maintain the look and feel) I would go for a template engine such as Velocity, which integrates nicely with Spring MVC and is designer friendly with most tools such as Dreamweaver.
Finally, JQuery to use some ready made Javascript widgets like calendar controls, popups, user messages and transitions.
Scala and Spring
精彩评论