A Funny Java Flavoured Look at the World

Friday, October 20, 2006

My first look at J2EE Design Patterns

As part of the SCWCD (Sun Certified Web Component Developer) exam you have to learn about J2EE Design patterns. You of course have the classic MVC, no I can't bring myself to talk about that.

I found at interestingly that Struts is not an MVC pattern but is a Front Controller pattern. It's weird really when people mention Design Patterns I always think of things like the Singleton or the Factory pattern. J2EE design pattern are a lot more centered on Web applications and aren't quite as interesting to me compared to the normal design patterns. They also seem more high level and don't really give you many code examples.

This link to Sun Design Patterns section is a really good overview corej2eepatterns , you can really see how the J2EE patterns fit together. Looking at this picture/layout I think highlights the difference for me between J2ee pattens and classic design patterns, classic design patterns are bits of code that can be used anywhere you are coding, j2ee are just used for web apps. This is probably obvious to everyone else but I though I would just air my dumb thoughts.

Here are another couple of good resources for J2EE design patterns

http://www.whizlabs.com/tutorial/scwcd/index14.html

http://java.sun.com/blueprints/patterns/catalog.html

It interesting to me that although they are not as interesting in a pure coding sense they are still very useful in explaining why struts is so useful and popular. It also gives you ideas and best practices of how to add things to your web app in a scalable and maintainable way.

2 Comments:

  • The traditional j2ee patterns are becoming slightly blurred, or evolving more so given the increase in uptake of Inversion of Control. For instance the traditional 3-tier approach is becoming more like a 2-tier approach with the business and data tier merging, especially with Spring/Hibernate. The big J2ee app companies will want you to develop according to the traditional patterns because it ties you into the gutsy web/business/data tiers and hence a web container and ejb container (expensive like Websphere)....but really....it's not required - you can achieve the same functional and performance requirements on Jboss/Geronimo etc. The j2ee space is slowly coming to this realisation.

    Ian Spence

    By Anonymous Anonymous, at Sun Oct 22, 10:42:00 pm 2006  

  • It is a very good comment that EJB coding popularity was reigned in by Spring and maybe hibernate. So much that they had to rewrite EJB to make easier to use.

    I wonder how ruby on rails fits into the J2EE debate. I haven't used it so I am not really fit to comment.

    By Blogger The Hosk, at Sun Oct 22, 11:53:00 pm 2006  

Post a Comment

<< Home