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.
hello room
everything is italicized! yay editors!
evil adrian
first post!
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
Thanks for the review, but it is rather pointless to write a whole story/article in italic. Italice (oblique) is kind of mark up.
Regards..
# Important Stuff: Please try to keep posts on topic.
# Try to reply to other people's comments instead of starting new threads.
# Read other people's messages before posting your own to avoid simply duplicating what has already been said.
# Use a clear subject that describes what your message is about.
# Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page)
Problems regarding accounts or comment posting should be sent to CowboyNeal.
dumbass
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
J2EE, huh? Sounds suspiciously like J2E2, the cousin of R2D2 that ratted to the Empire about his where abouts...
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?
"Democrats criticized the President for attacking the terrorists."
Be patriotic, impeach the Liars.
Thank you and a Happy Thanksgiving,
Kilgore Trout
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.
Mark my words. Blood will flow.
VeryGeekyBooks has more reviews of this book.
What's the difference between a Design Pattern and a template?
= 9J =
After all, it's been "one nation under God" since 1950s when the reference to God was sneaked in to the pledge our kids are made to recite. Why not follow the course to the end and just call it "mission accomplished"?
Vote out GWB in 2004. I don't care if you're Republican, Democrat or something else. That is your PATRIOTIC duty.
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.
Who let the trolls out (woof, woof, woof, woof)
Who let the trolls out (woof, woof, woof, woof)
When slashdot was nice, the moderation was jumpin
(Hey, Siggie, Yi, Yo)
And everybody havin a ball
(Hah, ho, Sig leven Yi Yo)
I tell the trolls start the First Postin
(Siggie Yi Yo)
And the moderators report to the call
The poor dogs mod down
Who let the trolls out (woof, woof, woof, woof)
Who let the trolls out (woof, woof, woof, woof)
Rap 1
I see ya little Taco head up our site
He really want to keep us down
But his readers are too stupid to see us comin
And everybody mods up us clowns
Verse
Im gonna tell
(Hey, Siggie, Yi, Yo)
To any Dan Hayes and Anne Marie
(Siggie, Yi, Yo)
Tell the dummy Hey Baby, Kiss MY Blade!
(Siggie Yi, Yo)
You fetch a moderator in front and her trolls behind
(Siggie, Yi, Yo)
Her points run out now
Chorus
Who let the trolls out (woof, woof, woof, woof)
Who let the trolls out (woof, woof, woof, woof)
Chant
Say, A troll is nuttin if he dont have suckers
All mods give up ya points, all mods give em up
A troll is nuttin if he dont have suckers
All mods give up ya points, all mods give em up
Rap 2
Wait for yall my trolls, the party is on
I gotta get my girl I got my goatsex on
Do you see the mods comin from my eye
What could you be first post
that Katz man thats breakin them down?
Me and My petrified short shorts
And I cant post a lot, any troll will do
Im figurin thats why they call me Lita Juarez
Cause Im a stupid man of the land
When they see me they go doo-doo (howl)
Chorus 5 Xs
Who let the trolls out (woof, woof, woof, woof)
Who let the trolls out (woof, woof, woof, woof)
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).
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.
You now have a fully working "design pattern". People from older methodologies will also refer to this as a Jackson Structured Design, a heirarchical design, a bottom-up implementation, an abstract data type, an encapsulated design, reusable code or a library.
Personally, I think we've enough techno-gibberish and that Software Engineers who introduce yet more to describe exactly the same scenario as some other jargon should be forced to read from
I don't mind jargon. I use plenty of it myself, but it's no use if nobody understands it. If there are more terms for the same thing than there are qualified programmers, you've achieved exactly nothing.
Instead of creating a comprehensible short-hand, which can be used to increase efficiency and re-use concepts as well as code, we're close to out-doing the story of the Tower of Babel - and we haven't even needed a pissed-off deity to produce the confusion of languages.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Eh?
Really, isn't a functional language like LOGO
(hmmm, something strange about that turtle head there) better?
And what about LOGO's big brother, Common Lisp?
C'mon guys! The Turtle is calling for you. Will you answer?
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
You obviously suffer from the same malady as the
fearful "leader" as evidenced by this logic:
"See, free nations are peaceful nations. Free nations don't attack each other. Free nations don't develop weapons of mass destruction.
--- George W. Bush--- Milwaukee, Wis., Oct. 3, 2003
Unfortunately, many alleged "patriots", such as you, are both illiterate and innumerate, as evidenced by your uncritical consumption of propaganda from the U.S. media and BushCo.
As always,
Kilgore Trout
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.
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