J2EE Design Patterns
If you are working on frameworks, integration projects or system components, it is my belief that you'll almost certainly pick up some ideas from this book. J2EE Design Patterns is organized according to the different layers that you might find in a multi-tier architecture: presentation, business, database, messaging, and others. Consequently, if you're a JSP developer on a project team, youll be able to get some ideas for how to organize your work as well as how to interface it with, for example, controllers, if you're following an MVC framework. Or, if you're integrating various distributed non-Java systems, you'll want to read the chapters on Business Tier Interfaces and Enterprise Concurrency.
Judging by my friends' bookshelves, another popular Java patterns book is Core J2EE Patterns. If you already own this book, you will find that this new offering from O'Reilly doesn't contain as many patterns per se, but seems to go into a greater level of detail describing each pattern and supplementing it with more code samples. A nice feature of the O'Reilly book is that each pattern gets ample coverage in enough detail for you to understand the actual problem, the causes and -- equally importantly -- how to put a solution into place. Each pattern is described using some UML notation and code samples (Chapter 2 contains a UML primer).
One of the problems that I've encountered reading books on the subject is that some steer so deeply into abstraction that they become hard to understand. Others are so stylistically repetitive that trying to read them becomes mind numbing. Fortunately, neither problem surfaced during the time that I spent reading this book. The authors avoided the visual repetition of the traditional Problem / UML / Goal / Actors format that other books follow by moving this type of description into an appendix. That lets the body of the book flow more easily and also supplies the reader with a handy quick reference in the back pages.
Do I have any complaints? Well, this book certainly doesn't suffer from any fatal flaws. But it seems that an acknowledgement of the popularity of certain components could have been included. For example, while specific MVC frameworks, like the ubiquitous Struts, were mentioned, Object-Relational mappers were not; I read some of the chapters and winced at the code samples that manipulated SQL strings and felt grateful that I'm using the wonderful Hibernate O/R mapping engine. Of course, for various reasons, some readers won't be able to use tools like these, and a book about patterns has to maintain a certain level of abstraction in order to maintain any lasting credibility. But the section on Object-Relational Mapping doesnt even mention that a class of tools exists without the use of EJB CMP (Container Managed Persistence). Thats a real shame, because manually moving data from the object world to the relational world and vice versa is time-consuming and error-prone (and frequently unnecessary) work.
It's a good book, with 285 pages of text and 53 pages of appendices. I've owned it for four days, and I've already managed to steal some of these ideas for the projects I'm working on.
Philip Jacob works for Eyeglasses.com. You can purchase J2EE Design Patterns from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I call it the tag delimeter pattern.
BSD is designed. Linux is grown. C++ libs
So is a Design Pattern just a clearly defined common problem and a general, language-independent, algorithm for solving the problem?
I have never heard that term before...
Not everything is analogous to cars. Car analogies rarely work.
though not J2EE (only "standard" Java) is 'Patterns in Java', coming in a few volumes, though I rate the first one highest, the other two get increasingly abstract/uncommon. When does a pattern become an occurrence ...
Simon
Physicists get Hadrons!
Conincidently a co-worker/cow-irker of mine just borrowed my copy. The nice thing about it is it gives some names to ideas a lot of us already use, making it easier to talk about them.
Your friend and well-wisher
m0smithslash
http://www.ferociousflirting.com
is the buzzword pattern.
Maybe I'm getting old, but at one time we just wrote systems that worked without regard to what was in fashion at the time.
Scottie: Cap'n - I confluckulated and strutified the entity beans, and I'm given 'er all she's got!
I've never really understood the point, because 'commonly ocuring problems/projects' are, by definition, commonly occuring. People who have spent any amount of time as a junior developer or a computer science student have been handheld through these types of scenarios about 1,000 times before they actually get to design anything important on their own. Beyond that, you're never going to be able to account for the wide varieties of situations that occur in the real world with one book full of templates. Maybe someone can sell this point to me? :)
====
Crudely Drawn Games
Someone has been eating too many acronyms laterly:
J2EE Design Patterns, GoF book, JSP developer, MVC framework, UML notation, SQL strings, O/R mapping engine, EJB Container Managed Persistence.
...is the spaghetti warehouse with a competence facade. Use it all the time.
I am a fan of design patterns but many of the patterns I see described in these books are workarounds for weaknesses or performance issues in the J2EE specs. In many cases a "best practice " tag is more appropriate than a design pattern.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
Patterns save time and effort by supplying developers with a shared language when discussing common problems.
Finally someone with an accurate description of what a design pattern actually is. In fact, that is ALL it is. I disagree that being able to identify patterns in your code saves time and effort though. And how does forcing patterns into your code help when, by definition, a design pattern is commonly occoring. Yes, you may have added new words to your vocabulary of programmer technobabble, but how helpful is it?
The basic concept behind a design pattern is to reduce common tasks to a set of repeatable and clearly-defined models. These models are:
Most businesses find themselves using one of three different design patterns. Larger businesses tend to choose one that is more suitable for dealing with a larger amount of business, whereas smaller businesses may find a more cost- and time-effective solution in a cheaper pattern.
I haven't read this book, but it's likely it'll touch on these and other design patterns. As always, it comes down to choosing the pattern you're most comfortable with.
VeryGeekyBooks has more reviews of this book.
What's the difference between a Design Pattern and a template?
= 9J =
I don't mind being modded down, but I mind if all you techies think the form, the presentation doesn't matter - it does. A text should be readable as easy as possible. Therefor it is not advisable to set it all italic. Fewer people might read it, fewer people might get the message. And usually that's not what you as a writer want.
Regards
Core J2EE Patterns is another book on the subject. You can even find many (all?) of the patterns from the book online.
I've found a lot of these patterns to be useful in other domains (PHP webapps) as well.
Is it just me or do others find this book to be unreadable and crazy ?
Design Patterns were inspired by the terrific book 'A Pattern Language' by Christopher Alexander.
But, in this book, a pattern is not -just- a commonly accepted solution. It's a solution that's really good, really works incredibly well, and feels like a fundamental thing. It's a solution whose insight leaves a lasting impression on you.
This is where the software design patterns people rather missed the point, and the razzing they get from older engineers is well-deserved.
I, for one, welcome our new Singleton(); overlord (sorry couldn't resist).
He's was involved in an MRI R&D project and was frustrated by the techies/engineers/scientists who insisted on using obscure slang without bothering to translate it. You know, the classical RTFM attitude of an elitist geek.
Over here they teach the MDs to deal with young and old people, people with low/high IQ, people with good/bad literacy and so on. In short, they teach social skills. In my mind, this should be made compulsory in the engineering/science degrees as well.
As I say to my students: if you can't communicate an idea in quantum mechanics to your grandma, you have not really understood the physics.
The owls are not what they seem
I remember commenting on some other topic regarding J2EE design patterns recently.
....
Like I sort of said that time, the design patterns are mostly just workarounds for a bad system. My advice is 'use JDO' and avoid all these problems (this is coming from someone working on both a JDO and a J2EE system right now).
I do in fact have one such EJB design patterns book, and its crazy the lengths they go to to make a broken system work
- Its too costly to make calls to an EJB's individual get methods - make a value object for each EJB!
- Don't like making all these extra objects, and coping with the extra maintenance required, and writing all the methods to transfer values between the EJBs and these objects? Transfer the information using a hashmap!
- Don't like the loss of all the advantages of using OO programming languages and entity beans instead of SQL which comes from passing everything with hashmaps? etc etc
Enough to make any experienced _object oriented_ programmer pull their hair out. Of course, if you prefer using the buzzwords of 'EJB design patterns' to the practicality of JDO then go ahead, code an EJB application - enjoy developing in an environment where the deployment required to test any changes is 5 minutes plus for any decent sized EJB project, where your $10,000s EJB server can't work out how to handle basic relations in the right order, and where you have to code half of your queries in SQL anyway (i.e. see the 'Data Access Command beans' pattern which the book no doubt has) as the system is so slow and not powerful enough.
Design patterns can be useful. The demonstrate good design in generally language neutral terms. They are useful teaching devices and solidly formalise a lot of things a lot of people having been saying in a lot of communities for a long time.
...
;).
... not 7.3, or 13 ... 73 ...
;)
...
:) (tm)
But they are not the end-all-be-all-panacea that some developers (and managers) imagine them to be. I have witnessed the following more than once, and it scares the hell out of me:
Oh, the proxy manager pool pattern in my framework does not have a helper. Perhaps a composite visitor pattern will suffice
I try to run the fsck away when I hear such atrocities (that is a euphemism, kids
What is more, one day bored, I wrote a small script to go through the tree, examine all class declarations.
The design pattern fanatics had a mean class name length of 73
They were also using delphi, so no typedef for them
Long story short, good teaching tool, awesome way to watch the stupid and uninformed create a tangled web of complexity to hang themselves in
Naturally, Your Mileage May Vary
joshua
If you want to know about design patterns (and you SHOULD), the Gang of Four book is the classic. However, I have found another book (Design Patterns Explained, by Shalloway) that really lays it out, explaining how to evaluate which pattern is right (or best) for a particular task or project. Read that book first.
... to use the new cover page on the TPS reports...
A book which doesn't mention alternatives to entitybeans and raw sql sounds quite outdated.
The story of cmp/ejb is really the tale of the emperor's new clothes. Three years ago any critique voiced against this new wonder tech. was labeled as uneducated drivel. But the truth was that anyone(ok not you) forced to work in this setting, was demonstrating terrible productivity.
As anyone reading theserverside.com will acknowledge, the emperor has now officially been declared naked.
Now it's time for the trial. Let's have a book examining how and why so many clever and bright people could be fooled so badly.
Sure, things can be refactored into a common library that can be used for things that won't need to change. But this is usually best done *after* it is determined a component is re-usable. This determination is best made after a component is reused a few times, not before it has ever been used at all.
Every one has written an XML toolkit, File toolkit, JSP toolkit, Swing toolkit, etc.. The Java SDK is a 'tookit' itself. This does not eliminate the need for design patterns. In reality, software is designed from the top down, where the top layer is the user/client interface(s). (where the client can be human,monkey,machine,other software,etc..). As the layers get lower and lower, they (should) become less volatile. Good bottom up designs are made better (more flexible,expandable) by design patterns.
Removing dependancies on the 'toolkits' can be extremely difficult without the simplest design patterns. Dependencies between layers of applications are to be avoided for obvious reasons.
Design patterns can't be avoided in good object oriented design. They are not a product of some company or focus group deciding developers need a new tool, they are natural occurences that have been observed and recorded during the development cycle that people have found useful and often necessary.
TallGreen CMS hosting
Soo's FORTH. I don't see anyone crowing about that
Besides LISP had it's chance...and it's share of hype as well. BTW I use Smalltalk, so their, pffft!.
...tell me how you really feel! If you think the ideas of an object system (entity beans) over a constant barrage into an RDBMS are bad, then you must really be pissing your pants now that Web Services is the new rage. Talk about one more re-hash for distributed computing. "Let's think of the slowest possible distributed computing infrastructure and promote that".
Maybe one can define all the patterns on a few basic patterns -- caller, callee, data store. In addition to GoF, "The Pattern Almanac" was the best book I found because it lists all the names of these patterns as used in various industries. As skilled programmers who know how computers work we all have done most of these before or could do them in a few weeks if needed. Personally, I think using pattern names is useful as it gives one more level of composition abstraction - something between talking about a module and a class perhaps.
Expect Freedom.
you'll see the four circles around the exit. lower traffic, and possibly just straight exit and entrance ramps w/out the loops.
On older freeway systems you got performance increases too from loop unrolling although todays freeway systems that is less and less of a concern because of new aggressive optimizing architects and civil engineer caching.
My comment has nothing to do with design patterns by the way - it's an implementation artifact of humor.
BSD is designed. Linux is grown. C++ libs
"But, sir, if the Vice President is such a Very Important Person, shouldn't we keep his Personal Computer on the Quick Time, 'cause if it leaks to the Venture Capitalists he could end up Missing in Action and we'd all be sent to maintain www.goatse.kp (North Korea)."
You make a strong point.
Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
Patterns are a common strategy/idiom for solving a common class of problems. Poorly applied patterns, indiscriminently applied or poorly-understood patterns will make things worse. Anti-Patterns are as important as normal patterns. (See above) A nice tool with pattern support/generation (Together ControlCenter) can help with implementation and understanding.
when the enevitable book,discussion, etc on patterns and their use in software I remind myself of Christopher Alexander , Austrian born, Cambridge educated maths and architecture graduate.
One aspect of Alexanders work often overlooked, is that we should be making up your own patterns. Instead we look to references as cook books rather than as building blocks.
peterrenshaw ~ Another Scrappy Startup