Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused about patterns?

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have been listening lot of buzz about patterns and this and that.. I also try reading online material for patters for J2SE , J2EE etc and I find myself still in trouble when it comes to implementing any of some of those patterns...
e.g. I understand Value Object, DAO etc and I have implemented them and it works in flexible way but I am still to figure out use of Factory, Singleton patterns and may be their combo in my implementations...
I tried to order a book "Design Patterns" from BookPool.com as it was cheaper there but I never recieved that book The reason I am still hesitant in buying it from amazon is- what I have observed is - "Patterns are quite logical". If we think little bit then we would have implementation that is some of the pattern without having "explicit" knowledge or awareness...though its good to know them...I used "Value object" even when I didnt know a word called "pattern" and after 2 years I realized "oh! that was Value Object" ...
in short I am still waiting for implementations that make me feel confident about use of Factory, Singleton and some other..I have never coded J2EE app so I don't know much about J2EE patterns...
Whenver I see examples, they seem correct but I find it hard to implement similar things when it comes to myself ...
any pointers for this mental illness?
Regards
Maulin
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're order for Design Patterns was the GOF version, I would consider yourself lucky. Many would disagree with me. IMO, it's very hard to read. Worse yet if you don't know OMT or C++.
You are quite correct that you will often invent the patterns yourself. One of the great benefits of patterns is that they give you a common vocabulary with your peers. When you say Value Object people know what you're talking about very quickly. ( I'm supposing you are talking about the pattern that has since been renamed to transfer object. )
Other benefits is that you get to leverage proven designs. You might know ahead of time what the short comings are too.
One guy around here whose opinion I respect recommends Applied Java Patterns. I have Grand's first volume and the GOF work. I seldom consult my copy of the GOF's pattern book.
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Maulin,
I have studied Design Patterns many times. In fact we are getting ready to start it again in January in the Research Triangle Park (RTP) near Raleigh, North Carolina. We meet once a month in the Borders book store.
Each time you look at a pareticular pattern brings a new level of understanding. IMHO the best way to approach the book is to meet with some friends and pick a pattern and talk about it (i.e. what it means to you, how you have used it in the past, etc). You need to discuss with others to share ideas. That leads to deeper understanding. There are even study guides available on the Web to help you!
The 23 patterns themselves fit together in patterns. It is just amazing. If you want to know where idea behing the software engineering design patterns came from check out the work done by Christopher Alexander on architectural patterns. It will blow your mind.
[ December 01, 2003: Message edited by: Howard Kushner ]
 
Gavin Bong
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howard,
How do you go about organizing a study group on design patterns ?
Is there "pattern" to the agenda that you follow during discussion ?
What text would you recommend using ?
Cheers,
Gavin
[ December 01, 2003: Message edited by: Gavin Bong ]
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Thanks for the responses.
Rufus, I know OMT and C++(little) and of course I am a java programmer for
couple of years (and that too with design as core criteria in mind always)
but its useful to know review from experienced like you about the book.
Howard, I agree with you but I have less friends in terms of these issues
with whom I get time to discuss things face-2-face and its hard for me to
communicate via these messages which can't speak So I get less exposure
in these respects. But I am sure given the willingness to learn, would get
me the friend list to meet just like you and for that I will have to put
strong efforts.
Gavin, as I mention I don't have access to personal meetings but if I guess
if you take a situation (each one of you may be) and think if any pattern
is applicable in any parts of your design and then try to explore the validity
and usefulness of each of those particular instances where you wanted to
apply patterns. Discuss "why" you chose a particular pattern? "how" would you
justify the use of a particular pattern?
Thanks again guys for useful input.
Regards
Maulin
 
Grub de Bliek
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's wrong to study the working of the design pattern itself, you should only study the situation it could be applied on.
Then, when you're developing you will sometimes run in situations difficult to solve. Then you will recognize those difficulties and think, "Hey! Doesn't the singleton solve this problem? How does a singleton work?"
And then you're gonna study the design pattern and implement it. This way you won't use much design patterns, but the number will grow when you get more experienced, and recognize more situations. Try to avoid to write your app around a design pattern, rather write your app and then refactor it with a design pattern.
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gavin Bong:
Howard,
How do you go about organizing a study group on design patterns ?
Is there "pattern" to the agenda that you follow during discussion ?
What text would you recommend using ?

I did a little surfing on Google using "Design Patterns" + study and this is the best link I could find right off the bat. Check it out and let me know what you think.
http://www.industriallogic.com/papers/learning.html
Regards,
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A "Design Patterns Explained: A New Perspective on Object-Oriented Design" book by Alan Shalloway and James R. Trott which I recomment.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Howard Kushner:

I did a little surfing on Google using "Design Patterns" + study and this is the best link I could find right off the bat. Check it out and let me know what you think.
http://www.industriallogic.com/papers/learning.html

It's a very good link - in fact I would have recommended it if you didn't already provide it.
We just did our first study group meeting at work last week, and it was very productive
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic