views:

414

answers:

4

I'm a php developer that uses Zend Framework extensively for developing at work. I've always liked some of the concepts put forward by Java but as I've rolled out big websites with ZF and had to work through performance/security issues I would like to use a framework in java that has similar features to Zend Framework or maybe bypasses some of the problems I've had in PHP development all together.

Things I'd like to have

  1. A good caching system/component (Zend_Cache abstraction is great offering usage of Memacached, or caching using files while offering different layers of caching e.g. page caching, file caching, outputcaching
  2. ORM or some implementation of the table data gateway pattern
  3. MVC implementation
  4. Routing system to customize urls for SEO/Usability purposes without having to write a whole bunch of rewrite rules in the htaccess.
  5. Security Provisions
  6. Good performance on complex applications (I know this is subjective but even comparison to other frameworks would be useful e.g. struts is faster spring, or even cross language seam is faster that zend framework, or spring is faster than code ignitor for those of you who have done both java development and php dev)

I had Seam in mind but I'm all ears to any framework or combinations of framework and extensions/components to accomplish this. Partial matches will also be a great help so I can evaluate the tradeoffs and maybe prepare to implement features I like myself. (Zend Framework because of the community nature of development has components for Amazon S3, twitter, etc etc which you comes in handy when you want leverage something quickly with out having to find out the caveats. A framework with similar background is a nice to have but not required)

+3  A: 

Spring framework is the best there is, IMO.

duffymo
A: 

I highly recommend you take a good look at Grails. It is based on the well-established Spring DI framework and Hibernate ORM. You can use plain Java code as well as the more leaner and similiar dynamic Groovy language.

stian
I think Grails is terrific, but I wouldn't want anyone to put that curtain of generated code in front of Spring and Hibernate before mastering them without Grails. I'd also recommend JDBC for a first-timer before Hibernate.
duffymo
+6  A: 

This question is a bit broad and could probably be rephrased to "How do I become a Java Web developer?"

You will need:

  • A Web container: Glassfish (my preferred option), Tomcat (just a Web container, not a J2EE application server like the rest), JBoss, Weblogic, Websphere (others);
  • I would highly recommend adding Spring to the mix no matter which you choose;
  • Web framework (not strictly necessary): Spring MVC, Struts, Seam, Tapestry, Wicket, many others. Some of these are more SEO friendly than others. It tends to be though that the more SEO friendly it is, the more work you have to do yourself;
  • Persistence: Hibernate, Eclipselink, OpenJPA, Spring JDBC, Ibatis, others; = Security: one thing Spring is good for (Spring Security);
  • Caching: EHCache, OSCache, Terracotta, Coherence, Memcache, GridGain, Gigaspaces, others.

Each framework/library in this list has various pluses and minuses. Every combination will have particular pluses and minuses and some are more suited to being paired with others.

So there is no quick answer to this.

cletus
+1 - Spring includes everything you recommended, as you well know, except for the web container. It seemed easier and comprehensive enough to give one reference.
duffymo
For web container I've used JBoss and intend to continue to do so . Webframework suggestion is really what the question is after so it seems your recommendation there is Spring over Struts/Seam? Persistance I liked the idea of hibernate and I liked the concepts put forward by EJB3 (again why I was tending toward Seam beause of the EJB3 integration). Under Caching are these options native support under Spring? or is it that I have to come up with a way to do different types of caching (page vs data) myself
Akeem
JBOSS is fine. Yes, I would recommend Spring MVC over both Struts and Seam. You can use Hibernate or JPA with Spring; EJB3 really is POJO persistence now, so nothing new there. If you're talking about persistence caching, Spring lets you plug in what you'd like: EhCache, whatever.
duffymo
And what about view caching? Also I really liked EJB3's use of annotations for persistence. From what I read Spring 2.5 supports using annotations for configuration so that seems to negate some of the benefits of going down the seam/ejb3 route right? And one last thing from your experience what do you think about Spring applications performance when compared to similar php applications (I'll try to factor in your bias of course :) ) Thanks
Akeem
A: 
  • Spring no matter what
  • Tomcat is the simplest web server you can use
  • if you insist on an ORM look into iBatis or Hibernate

the above will keep you busy for quite a while ...

Billy