Hi, I've been in Java for 2 years mostly developing web applications. I am new to design patterns, but I ve been reading a lot about it. Now, what I want to ask is what are the situations and problems in web apps where I can find patterns usefull? Thanks, Vlad
Originally posted by Vladimir Ergovich: Hi, I've been in Java for 2 years mostly developing web applications. I am new to design patterns, but I ve been reading a lot about it. Now, what I want to ask is what are the situations and problems in web apps where I can find patterns usefull? Thanks, Vlad
Patterns are simply reusable solutions to common, recurring problems. It's often easier to start looking directly at the problems you have and then branching out to more general, less technology-specific kinds of solutions. As other posts have suggested, you might want to start with the book "Core J2EE Patterns", which provide specific solutions that have worked in multiple J2EE projects. Then you might want to read the featured book, and/or the original "Design Patterns: Elements of Reusable Object Oriented Design" book, and start thinking about ways in which you can apply these general principles to your specific problems. Design Patterns are general-purpose tools. You can't just ask someone "how do I use nails in building a house?" The answer would be too broad to be useful. Your question is similar. Take some time to learn about the patterns first, and then you'll start seeing the applicablity on your own. Kyle Brown
I would agree that this is a hard question to give a cut and dry answer to but I can suggest one example. Consider login authentication. This is a situation where you could apply the Command Pattern. It is a process you will want to repeat frequently. You take incoming requests and forward them to a controlling servlet which will perform the authentication and create the command object. For a more detailed description of the implementation you could refer to O'Reilly's Servlet Programming book (I believe it is the one with the tea kettle on the cover) although they don't refer to it as the Command Pattern.Yoou can review the Command pattern at http://myweb.onramp.net/~huston/dp/patterns.html
Joined: Aug 10, 2001
Another suggestion (that I can't believe I've forgotten to make so far) is that Patterns are by far best learned in groups. Get together with a couple of your buddies and do a reading group that meets once a week over lunch to discuss one pattern a week. You'll see that it's much easier to learn this in a group than it is alone. Another possiblility is to look at http://www.hillside.net and see if there isn't a patterns reading group already formed in your area that you can join. Good luck! ------------------ Kyle Brown, Author of Enterprise Java (tm) Programming with IBM Websphere See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information. [This message has been edited by Kyle Brown (edited October 04, 2001).]
Regarding design patterns - as they relate specifically to web applications - I have always found the IBM redbooks (anything about VAJ/WAS/EJB/XML) to be very useful (www.redbooks.ibm.com). Even if you don't use the IBM product range, there is a lot of good information included here (I work for IBM, but this is my objective opinion!). The Apache Struts project also has some information on the basic motivation for MVC in web apps. For more enterprise oriented patterns in a 'web' context - the SUN site has some J2EE patterns. All of these sources discuss to a greater/lesser extent, the motivation and advantages of employing particular patterns. regards, paul.
Another suggestion (that I can't believe I've forgotten to make so far) is that Patterns are by far best learned in groups. Get together with a couple of your buddies and do a reading group that meets once a week over lunch to discuss one pattern a week. Good idea Kyle [This message has been edited by Johannes de Jong (edited October 05, 2001).]