File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Head first design patterns and Patterns in general Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Head first design patterns and Patterns in general" Watch "Head first design patterns and Patterns in general" New topic

Head first design patterns and Patterns in general

Marcelo Ortega
Ranch Hand

Joined: May 31, 2005
Posts: 528

Would it be a good idea to use adesign pattern for the SCJD?
What about 3-Tier and the like? Should i research the Tier?
Would Head first design patterns be useful for the SCJD in any way?

Thanks in advance,
[ October 01, 2005: Message edited by: Marzo Khaan ]


Live life to an interface, not an implementation!
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11776

Hi Marzo,

Yes ... and no.

Design patterns are a tool. They provide a way of thinking about your proposed development, a design to build your solution, and a method of explaining your solution to others.

They are patterns - that is, the things that they describe turn up so often that they are recognizable. You are almost certainly using some design patterns already, whether you realize it or not.

Learning about design patterns is definately a great idea for both of these reasons. When designing a solution to a problem, you will probably spot places where a design pattern will fit, and suddenly that whole section of the problem is solved. Likewise, in the real world, it is much easier to mention which design pattern is used, rather than trying to describe the individual parts of the solution (no matter whether you are the developer trying to explain your solution to other developers, or whether you are trying to understand somebody else's design). Or, as Kathy, Bert, Eric and Beth said it much better than I can:
[qb]From Head First Design Patterns "local diner" example:
Alice (to cook):
I need a Cream cheese with jelly on white bread, a chocolate soda with vanilla ice cream, a grilled cheese sandwich with bacon, a tuna fish salad on toast, a banana split with ice cream & sliced bananas and a coffee with a cream and two sugars, ... oh, and put a hamburger on the grill!

Flo (to cook):
Give me a C.J. White, a black & white, a Jack Benny, a radio, a house boat, a coffee regular and burn one!

What’s the difference between these two orders? Not a thing! They’re both the same order, except Alice is using twice the number of words and trying the patience of a grumpy short order cook.

What’s Flo got that Alice doesn’t? A shared vocabulary with the short order cook. Not only is it easier to communicate with the cook, but it gives the cook less to remember because he’s got all the diner patterns in his head.

Design Patterns give you a shared vocabulary with other developers. Once you’ve got the vocabulary you can more easily communicate with other developers and inspire those who don’t know patterns to start learning them. It also elevates your thinking about architectures by letting you think at the pattern level, not the nitty gritty object level.

So what we end up with is a situation where, if you know the patterns, as you design your solution you will probably think "ahh, pattern 'x' will fit well here. Or "hey, this sounds like I've just used pattern 'y'. And you can document it as such if you like.

But your question "should I use a design pattern" - is thinking about this the wrong way. You will almost certainly use one or more design patterns in your solution whether you realize it or not. Plus it leads to the question "which design pattern should I use", which is like asking if you should use a 12mm drill when building a house - you might use the 12mm drill, but you should not try to design the house just so you can use it.

Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Marcelo Ortega
Ranch Hand

Joined: May 31, 2005
Posts: 528

Great reply Andrew (as usual) and thanks for your time (it's clear now).

I agree. Here's the link:
subject: Head first design patterns and Patterns in general
It's not a secret anymore!