Slashdot Mirror


Design Patterns

BShive writes "Design Patterns is considered a classic for anyone in software development. The beginning third of the book is a solid introduction to patterns, while the last two thirds of the book is devoted to the patterns themselves. Many of the professionals out there probably already own a well-used copy of this book, but there are others who are wondering what all the fuss is about. The frequency of hearing about this text in discussions piqued my interest enough to buy it for myself. If you are interested in design patterns and are looking to use them, then this should be one of the books on your shelf." Read on for more. Design Patterns author Erich Gamma, et al pages 395 publisher Addison-Wesley rating 8 reviewer Ben Shive ISBN 0201633612 summary Design Patterns is considered a classic for anyone in software development. Many of the professionals out there probably already own a well-used copy of this book, but there are others who are wondering what all the fuss is about.

Introduction

I found the entire introductory section excellent, and a good read. It covers what design patterns are and explains how they are documented and categorized. Advice on where and how to employ design patterns to achieve reusable and flexible software is also covered to give you an expectation of what you can get out of the rest of the book. The What, Why, and How are covered nicely. Even with little previous exposure to patterns, I was able to understand the presented material easily and begin to see the applications.
Object Modeling Technique (OMT) notation is also introduced to explain the diagrams associated with the patterns and examples. If you have used UML, the diagrams and notations will be familiar to you since UML is influenced by OMT. Jim Rumbaugh, the creator of OMT, collaborated with Grady Booch to create the first version of UML.

As the author notes, having a solid knowledge of OOP is critical to being able to understand and use the information presented. If you don't fully understand OOP, pick up an introductory text first. An Introduction to Object-Oriented Programming by Timothy A. Budd or any similar book will get you up to speed. However, you will get the most out of Design Patterns with hands-on OOP experience.

Case Study

This chapter presents a case study in designing a WYSIWYG document editor to demonstrate how design patterns can be applied. Most of the examples in the book involve the user interface and I would have liked to see less emphasis on UI models. However, it still gives the reader insight into real applications of patterns. Not only do the authors point out how the pattern applies to each case, but they also present the problems associated with the application. The case study is not intended to set up a perfect example of pattern usage, but to explore it. The reader could go further with the design presented and think about how to solve the flaws pointed out along with the ones that have not been discussed. I liked the fact that they do not attempt to state that there is only one way to solve the problems presented, or that their solutions are even the best way. Too many authors fall into this trap.

Presenting: The Patterns

The three chapters on patterns make up the bulk of the book. The patterns are separated out into the three chapters by type: Creational, Structural, and Behavioral. Each chapter begins with an overview of what the patterns of the type can be used for, and how the chapter deals with the patterns as a group. At the end of each chapter there is a discussion section that summarizes the patterns, along with guidance on how to select the right one from the chapter.

Each pattern description contains a number of sections: Intent, Also Known As, Motivation, Applicability, Structure (in OMT), Participants, Collaborations, Consequences, Implementation, Sample Code, Known Uses, and Related Patterns. The breakdown makes it easy to determine if, why, and how you should use the pattern. The authors are justifiably concerned about using the wrong pattern for a given situation. The code snippets are also easy to work through as long as you know an OOP language. C++ is commonly used, with the occasional bit of Smalltalk code.

The three chapters that detail each pattern would be difficult to read right through. However, the opening and closing section of each chapter has valuable information and is worth reading and subsequently referring to some of the patterns discussed. I got the most out of these chapters by picking patterns that might apply to current projects I was working with and then exploring one in depth, branching over into other patterns in a non-linear fashion.

Conclusion

The closing chapter is relatively short, but makes some important points. The authors discuss what to expect from design patterns, some history and other references/influences. Re-factoring is discussed and how patterns will help mitigate this unavoidable process as the software evolves. Other benefits are also brought up briefly. The book closes with an invitation to give the authors feedback and to find patterns that you use. The best designs will use many design patterns that dovetail and intertwine to produce a greater whole.

Book Extras

The whole book has a quality feel to it that is missing from many current texts that cost nearly twice as much. Inside the front cover there is a quick reference to all of the patterns contained in the book with a brief description and page number. The back cover also contains a quick reference for diagram notation and the relationships between the design patters. This is all topped off by two bookmark ribbons attached to the spine.

The Age Issue

Design Patterns was originally published in 1995, and the book mentions that the patterns it contains are little changed from 1992! In the computer field this would be considered an ancient text with how fast software is updated and languages change. Despite this, since the material is not entirely dependent on a particular language or program it holds up quite well. The examples referred to for each pattern are older software that many will not recognize. An updated version would be nice, but being old does not condemn this book to being useless.

Summary

This is an excellent book even if it is beginning to show its age. The fact that it's still very useful is testimony to the quality of the material. A few readers might find the reading to be a bit dry, but the straightforward style was refreshing compared to some other texts. The authors stay focused on the topic and condense it appropriately without going off onto long tangents. Once I've followed through with applying some patterns to projects it might garner an even higher rating. Just from reading about some of the patterns, I could see how they could have applied to previous projects I've worked on, both large and small. The book was certainly a worthwhile investment. If a second version of this book ever comes out, I'd be sure to pick it up as well.

Chapters:
1. Introduction
2. A Case Study: Designing a Document Editor
3. Creational Patterns
4. Structural Patterns
5. Behavioral Patterns
6. Conclusion

Appendix:
A. Glossary
B. Guide to Notation
C. Foundation Classes

You can purchase 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.

309 comments

  1. Since the author didnt mention it... by josh+crawley · · Score: 2, Insightful

    Is this book worthy of my money or is it antiquated piece of shit? The author of this review didn't include any sort of this question.

    I have only limited funds, and I cant afford something that wont help me. So... all those who bought it, is it WORTH IT?

    Thanks.

    1. Re:Since the author didnt mention it... by Anonymous Coward · · Score: 5, Informative

      Get it if you can afford it. If not, try to find a second hand copy. Failing that there is plenty of resources on patterns on the net:

      Bruce Eckel has one in development available here:
      http://www.mindview.net/Books/TIPatterns/

      There are other places too:
      http://www.csc.calpoly.edu/~dbutler/tutorial s/wint er96/patterns/

      See what Google brings up for you.

    2. Re:Since the author didnt mention it... by Vengeance · · Score: 5, Insightful

      Damn straight it's worth it.

      As a developer, this book helps you to codify some concepts you've already got in your head, so you can latch onto them and understand them better. Patterns are applicable at every level, from little 20 and 50 line modules up to arbitrarily large systems. Get this book, or one based upon it that uses the language of your preference.

      --
      It was a joke! When you give me that look it was a joke.
    3. Re:Since the author didnt mention it... by johnbr · · Score: 5, Informative
      Design Patterns is an extremely valuable reference book. It uses C++ examples, but in almost all cases these can be translated into Java (which is the only other language I use regularly right now).


      It suffers from an overdependence on GUI-based descriptions, which were difficult for me to absorb, given my back-end system focus. However, every few weeks or months something will fall into place and I'll suddenly get the usage of one of the patterns that I didn't understand before.


      Patterns are a great "show off" tool - useful to intimidate those who haven't learned about them yet. Since you'll be on the intimidatee side until you read it, it is good to have a copy for that reason as well.


      Some of the patterns are easy to understand and easy to use - Singleton and Observer. Others take more time before you "get it", and many you may never learn, nor need to.


      But all in all, I think you'll feel smarter for having read it (even if you only "get" pieces of it), and it will probably help your architectural sophistication, and might even present a handy solution to a frustrating design problem.

    4. Re:Since the author didnt mention it... by MisanthropicProggram · · Score: 1

      Yes, it's worth it. Not only did it help me understand OOP better, but it also helped me understand the STL's design and how to use it more effectively. It helped make me a better designer too.

      --

      There is no spoon or sig.

    5. Re:Since the author didnt mention it... by diverscuba023 · · Score: 1

      I'm glad that I bought it. Its been a life saver many times along with Fowler's book on Refactoring it is one of my most frequently referenced books. even more so now that I'm teaching instead of programming :

    6. Re:Since the author didnt mention it... by rmolehusband · · Score: 3, Informative

      Is this book worthy of my money or is it antiquated piece of shit? The author of this review didn't include any sort of this question.

      That's kind of subjective, one man's 'must have' is another man's 'antiquated piece of shit', so it's always a tricky proposition to make such a sweeping generalisation in a review.

      On the other hand, you should be able to get a flavour of the book from the review and decide if it's something you *might* be interestd in. Then you spend and hour or two in your local bookstore (remember them?) reading and deciding for yourself - which, having never come across the book before and having had my interest roused, is what I'll probably end up doing.

      --
      Reginald Molehusband. Edinburgh, Scotland
    7. Re:Since the author didnt mention it... by Anonymous Coward · · Score: 3, Interesting
      This is the most inspirational book I have ever read for OO programming. There is no competition. When you read this, you will understand how to programm OO well. In addition, much of Java's libraries are based on patterns, so I say this is a must-read for anyone who wants to learn how to write quality Java code and also understand the Java libraries. The same probably goes for C# since that is Java in sheep's clothing. ;)

      If you like this book, I also recommend trying to find the (free!) whitepapers from Taligent about object-oriented frameworks. They may be hard to find since Taligent is long gone, but I am sure there is a copy on the net somewhere. They did go off on tangents at times, but they are still worth reading. (I believe some of the people who wrote this book were also on Taligent's research team.)

      I used both works quite a bit in my undergrad thesis. Though without this book's inspiration, the thesis would have likely not come to be.

    8. Re:Since the author didnt mention it... by sprior · · Score: 1
      In some circles it is simply becomming required reading and may be worth your money for that reason alone. I was once asked in an interview to rough out an OO design for the project they would be hiring me for. I quickly came up with a design which was good and based on patterns in my head based on my experience. Then the interviewer asked me what patterns I could see in my design and because I hadn't read the book yet I didn't have the proper lingo to feed back to him even though my patterns matched the books patterns very closely.


      I thought the introduction of the book was pretty good and the book overall is very good. My only ccomplaint is that the book suffers a bit from the kind of writing you'd see in a Phd thesis - it takes itself a bit too seriously and uses dense language just for the sake of sounding lofty.

    9. Re:Since the author didnt mention it... by Anonymous Coward · · Score: 1, Informative

      It's good but there are lots of places on the web that provide similar information.

      I'd recommend reading it more than buying it; if your experience is similar to mine then you will probably end up going through it once or twice, thinking "ah, I used that in such and such a design", use it as a reference once or twice and then leave the book sitting on a shelf gathering dust. It has changed the way I design systems (for the better) but I also found that it was quicker to build up an overall understanding of unknown code written using patterns, simply by spotting where they're used.

      There's a lot of information in the wiki at www.c2.com; it's probably useful to read:

      http://www.c2.com/cgi/wiki?PatternsForBeginners provides a reasonable introduction.
      http://www.c2.com/cgi/wiki?DesignPatternsConsidere dHarmful

      The patterns themselves can be dangerous, as I've found myself on some occasions, as they foster a detachment from the implementation details. There is a tendency to knock out code quickly because you know the design well, but the resulting code contains subtle flaws that aren't considered in the GOF book.

      Alexandrescu's book, Modern C++ Design, discusses the implementation of factory patterns, visitor and singleton, which is regarded as being one of the simplest patterns to understand but hard to implement well. Apparently one of the authors of the GOF book once stated that he wished singleton had not been included in the book.

      For interest, perhaps look at
      http://c2.com/cgi/wiki?SingletonsAreEvil

      It's worth buying if you can't find a copy to read and you have the spare cash at some point, simply because it can be hard to find information on some of the less used patterns in the book on the internet.

      Hope this rambling is useful.

    10. Re:Since the author didnt mention it... by demultiplexer · · Score: 2

      It may be the first and oldest (software) pattern book around, but it still is the very best I've read. Consider this. The book introduces 23 patterns. In the ten years elapsed since its appearance, perhaps half a dozen more patterns have been formulated that can hold their own beside them. Others are derivative, have a very specific application domain, or are about something entirely different altogether (from XML patterns through organisational patterns to anti-patterns).

      If you'd write the book today, you would probably use different programming languages but really, the concepts may be complex but the examples aren't. If you are proficient in one or two modern OO languages I doubt you'll have a hard time deciphering them.

      Treat yourself. Buy the book. Keep it in your bag and next to your bed. It will stretch your mind, clear up your thinking, and give you a new vocabulary.

      - Peter

    11. Re:Since the author didnt mention it... by Ripplet · · Score: 1

      Absolutely it's worth it, this is my most used reference book, yes even more than my Stroustrup. I have saved myself a lot of time and effort by using some of these patterns, you can probably get the same benefit.

      --

      Skiing? Check out The Independant Skiers Portal

    12. Re:Since the author didnt mention it... by Luke+Skyewalker · · Score: 0

      Actually, those patterns are very much language independent (at the time of the books writing, they were using smalltalk examples). Design patterns act as a way to communicate a larger idea or concept to the user. It's easier to tell another OO designer that a "singleton" is a good creational pattern for a particular task, than if I were to go into detail on how to implement a single, shared instantiation mechanism in (your language of choice here).

      However, a lot of people fall into a trap of using a pattern they just learned to solve any problem. Ever see factories within factories? I have. It's not pretty. The patterns aren't meant to be used "as is", either. They're meant to be modified to fix a problem.

      For someone just starting out in C++, I'd advise them to avoid using pattern initially, and sticking with simpler solutions. When the problemspace becomes more complex, then one may want to reconsider reading the "Gang of Four" book for ideas on solving the problem.

    13. Re:Since the author didnt mention it... by CowboyBob500 · · Score: 2, Insightful

      antiquated piece of shit

      The book is about design patterns. How can it be antiquated? Unless you're still programming in BASIC...

      Bob

    14. Re:Since the author didnt mention it... by jgoral · · Score: 3, Funny

      The single sentence in the middle of page 18 alone is worth you mony.

    15. Re:Since the author didnt mention it... by hoegg · · Score: 2

      I am a great fan of Bruce Eckel's work. I have read his in-progress book Thinking in Patterns with Java.

      Either there is a lot less to design patterns than I hoped (unlikely) or the book doesn't cover enough basic material for me to understand. I think I am going to buy the Gang of Four book just to find out if I'm missing anything.

    16. Re:Since the author didnt mention it... by Hater's+Leaving,+The · · Score: 1

      I have seen design patterns do more harm than good.
      I've seen people suddenly feel like they were able to design and code complicated systems because they were armed with this book. And I've thence seen them churn out a complete pigs ear.

      It's only a good book in the hands of a decent coder.

      THL.

      --
      Keeping /. cynic density high since the fscking Kwhores/trolls arrived.
    17. Re:Since the author didnt mention it... by MrResistor · · Score: 2

      Is this book worthy of my money or is it antiquated piece of shit? The author of this review didn't include any sort of this question.

      From the article:

      The fact that it's still very useful is testimony to the quality of the material.

      That would appear to answer your question.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
    18. Re:Since the author didnt mention it... by smunt · · Score: 1

      Great thing about Fowler's book is that it's aimed at writing simple OO code. It explains real good not to overuse patterns.
      Ofcourse, using patterns at the right place can make your code much more readable for someone with pattern knowledge. It allows people to think at a higher level of abstraction.

    19. Re:Since the author didnt mention it... by Anonymous+Brave+Guy · · Score: 2
      I was once asked in an interview to rough out an OO design for the project they would be hiring me for. I quickly came up with a design which was good and based on patterns in my head based on my experience. Then the interviewer asked me what patterns I could see in my design and because I hadn't read the book yet I didn't have the proper lingo to feed back to him even though my patterns matched the books patterns very closely.

      If you didn't get the job on that basis, at least you know you didn't want to work there. After all, the smart-ass doing the interview completely missed the point of patterns. :-)

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    20. Re:Since the author didnt mention it... by Anonymous Coward · · Score: 0

      Patterns are a great "show off" tool - useful to intimidate those who haven't learned about them yet.

      Indeed. I have worked with a number of people who will treat you like an idiot if you don't understand the <invent your own name here> design pattern.

      Design Patterns are valuable but often very over rated. The main advice I usually have re design patterns is that over engineering a solution is Always Bad, and in applying patterns it is important to ask yourself "Do I need this, or am I just using it because I can?".

      Knowing when not to over engineer is a very important skill, and knowing how to refactor is one of 'the' most important skills - so that you don't have to design by crystal ball gazing.

    21. Re:Since the author didnt mention it... by Anonymous Coward · · Score: 0
      Either there is a lot less to design patterns than I hoped (unlikely) or the book doesn't cover enough basic material for me to understand.
      ...or there's just a lot less to Bruce Eckels than you had hoped. ;-) The GOF book is a classic CS text. It belongs on every programmer's shelf.

      Get a copy.

      Read it.

      Read it again.

    22. Re:Since the author didnt mention it... by Anonymous Coward · · Score: 0

      Yes, the author DID include this sort of information. Reading the last two lines of the summary paragraph would tell you.

      Summary ... The book was certainly a worthwhile investment. If a second version of this book ever comes out, I'd be sure to pick it up as well.

      dammit people. read the friggin posts!

  2. Designing Patents ?? by StefMeister · · Score: 3, Funny

    For a second there I thought it said designing patents. I guess that's what happens when you spend more time reading /. than doing your actual programming work. :)

    --
    "Son, in a sporting event, it's not whether you win or lose, it's how drunk you get" - Homer J. Simpson
  3. Learn from the masters by Anonymous Coward · · Score: 5, Informative

    This book IS the definitive word on the use of patterns, I have used it and will vouch for it.

    However, for all the knowledge it contains it has a price tag to match. If you can get it used and cheap, do so.

    AC

    1. Re:Learn from the masters by back_pages · · Score: 2

      "To anonymously vouch or not to anonymously vouch, the value of this is in question."

    2. Re:Learn from the masters by baywulf · · Score: 2

      Okay if an anonymous coward vouches for it then it is settled. I'll go buy the book right now.

    3. Re:Learn from the masters by viggen · · Score: 0

      You get a cheap copy here

    4. Re:Learn from the masters by tswinzig · · Score: 1, Redundant

      This book IS the definitive word on the use of patterns, I have used it and will vouch for it.

      Well, if an AC is going to vouch for it, what else is there to say!

      --

      "And like that ... he's gone."
    5. Re:Learn from the masters by Luke+Skyewalker · · Score: 1

      However, for all the knowledge it contains it has a price tag to match. If you can get it used and cheap, do so.

      Or get your company to pay for it. They did for my copy...

    6. Re:Learn from the masters by Anonymous Coward · · Score: 0

      Oh c'mon, GoF is not that expensive--about $50. Even at minimum wage, that's only 10 hours of work. And if you're making minimum wage doing object-oriented design, you really should be looking for a new job...

  4. Nice to see /. as up to date as ever by Anonymous Coward · · Score: 0, Insightful

    This book was published what, 8 years ago !

    Nice to see /. at the leading edge as usual.

  5. many professionals have well worn copies by rot26 · · Score: 1

    Actually I sort of doubt that.

    --



    To ensure perfect aim, shoot first and call whatever you hit the target
    1. Re:many professionals have well worn copies by Anonymous Coward · · Score: 0

      Why?

    2. Re:many professionals have well worn copies by Anonymous Coward · · Score: 0

      Many professionals have copies, some of the copies have even been opened a few times.

  6. Designing and Patterns by CatWrangler · · Score: 4, Funny

    I have never seen a code monkey in a well designed patterned outfit. I wonder if this book will help at all.

    --

    ---
    When you come to a fork in the road, take it! --Yogi Berra--

  7. history lessons.. by TechnoVooDooDaddy · · Score: 5, Insightful

    hehe design patterns remind me of the quote "Those who do not learn from history are doomed to repeat it." or something like that...

    if a problem has been solved, and well thought through, the pattern published and peer-reviewed, it probably will hold up for a good long while.

    1. Re:history lessons.. by vrmlguy · · Score: 3, Insightful
      In other words...

      while (!history.learn()) { snafu(); }
      --
      Nothing for 6-digit uids?
    2. Re:history lessons.. by insac · · Score: 1

      Well, the sentence is more connected to "AntiPatterns" :-)

      --
      This message doesn't need a sig
    3. Re:history lessons.. by Anonymous+Brave+Guy · · Score: 2

      Alas, often the only thing we learn from history is that we do not learn enough from history. Maybe that's why so many development shops still regard patterns as some sort of academic exercise, and continue to reinvent the wheel in a slightly less round way...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  8. Next Up in the Obvious Category... by GeekLife.com · · Score: 5, Funny

    Can we get a review of this site, slashdot.org I've heard so much about?

    Sorry, I'd just thought everyone had heard about Design Patterns long ago. Seems a bit like publishing a book review on the KJV Bible or something.

    1. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0

      This was my reaction as well.

      An anecdote: When I first started OOP, I was writing something and decided I needed an object that could only be instantiated once. So I hacked at it for a day or 2, and got that working, and I was feeling pretty clever.

      A couple weeks later, I heard that this "Design Patterns" book was a must have. So I got it...and then read about this "Singleton" thing....doh!

    2. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0

      I agree, this doesn't seem like news, neither did that desktop/mobile CPU stuff yesterday. Come you guys are slipping here :)

    3. Re:Next Up in the Obvious Category... by Dark+Paladin · · Score: 3, Insightful

      Considering that the book uses pieces that are over 7 years old in a world where technology changes every few months, this review was useful to me - it told me that the information was still useful, valid, and actually might help my programming skills.

      So no, I don't believe it was obvious at all - considering that I hadn't even heard of the book until today. (Yes, let the flames commence - I must be a bad, awful programmer because I haven't read some book.)

    4. Re:Next Up in the Obvious Category... by Phouk · · Score: 2

      I guess it's a repositioning of "Slashdot: News for Nerds" to "Slashdot: Stuff for People."

      I'm just glad they have their target market so well defined.

      --
      Stupidity is mis-underestimated.
    5. Re:Next Up in the Obvious Category... by archeopterix · · Score: 1
      Sorry, I'd just thought everyone had heard about Design Patterns long ago. Seems a bit like publishing a book review on the KJV Bible or something.
      Yeah, this book is a classic, yet I find it hard to believe that it is under every developer's pillow. Take for example the Observer pattern or even better, Model-View-Presenter. Now take a look at any of the popular 'visual programming environments'. Try to find MVP, or even Observer. Separating model from view? The 'model' is scattered through hundreds of event handlers attached to controls (the 'view' part). Ok, if you try hard you can implement these patterns but it's far from natural. So, i'll repeat this: this book might be a classic, but IMHO it is too classic to get into some heads. Perhaps in a few years we'll hear of MVP as the ultra new approach to GUI building in a Slashdot ad.
    6. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0

      >the book uses pieces that are over 7 years

      10 years, even! "Design Patterns was originally published in 1995, and the book mentions that the patterns it contains are little changed from 1992"

      I`ve never heard of it either. I`m not sure where people get off being smart arse and `Oh, i heard about it years ago`. So what? Someone told you sooner, that's all. Get over it.

    7. Re:Next Up in the Obvious Category... by dalassa · · Score: 2

      This was one of the required texts for my intro to programming class and even though I've given up programming its one of two books I still find useful. The other being Introduction to Algorithms which I use as a doorjamb.

      --
      Feminism is the radical notion that women are people.
    8. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0, Interesting

      King James Version Bible

      This bible was the first English translation of a bible. It is relatively close to the original biblical text (considering some of the other translations I have seen)

      But remember from Aramaic->Greek->English is still a long ways off from the original. It is however a good read and IMHO the closest English translation we have.

      What I would love to see is a hard core translation with absolutely no politcal or viewpoint wrangling involved. Maybe if we get a machine to do it, but then the programmers would influence it and the output would be the following:

      "God is a pink unicorn in the sky who you can't see so don't bother."

      pieces,

    9. Re:Next Up in the Obvious Category... by main() · · Score: 1

      > Sorry, I'd just thought everyone had heard about Design Patterns long ago.
      > Seems a bit like publishing a book review on the KJV Bible or something.

      The KJV Bible??? Okay, let me guess... Knuth, Joy and Van Jacobsen got together, right?

      Gimme gimme gimme 8-)

      Si

    10. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0, Funny

      Mmm, you want a summary of the KJV? That's not hard... :)

      Well, it all starts when God makes the universe in a week or so, then this guy, Adam eats an apple because his wife, Eve told him to, then they get kicked out of this garden & have a bunch of kids. Then the kids kill each other (literally), get cursed, form a bunch of nations which war with each other & junk.

      Then, this guy Abraham sacrifices his son, Isaac, only he doesn't. So they sacrifice this goat who got stuck in this bush, instead. Then Isaac has a son, Jacob who sees a ladder to Heaven & wrestles with the Angel of the Lord, and no, I'm not pulling your leg ;) Jacob also manages to get his father's blessing instead of his brother, Esau. Jacob's son, Joseph then makes his brothers jealous, so they sell him into slavery, but he becomes the Pharoah's assistant & saves them all from famine. So he gets the double portion of the eldest son (instead of Reuben, who was the eldest), and we wind up with the 12 tribes of Israel from all the sons of Jacob--namely: Joseph, Reuben, Simeon, Levi, Judah, Issachar, Zebulun, Benjamin, Dan, Naphtali, Gad & Asher. So all of them live in Egypt now & eventually wind up as slaves.

      Then this other guy, Moses is born. He's really beautiful (for a baby) so they throw him in the river in a basket so he won't get killed (because those Egyptians wanted to kill all the Israeli babies so they wouldn't be a threat to them). Anyhow, he gets raised by the Pharoah's daughter, but later talks to a burning bush (God) & decides to free all his brothers from Egypt. So he unleashes a bunch of plagues (10 of them; see Exodus 7:11) until they've had enough & he gets all the people to leave there quickly--so quickly they don't have time to let their bread rise (hence, it's unleavened).

      So then they run away, part the Red Sea, drowning all the Egyptians who tried to follow them & get their slaves back by flooding the sea behind them. Then Moses goes up this mountain (Mt. Zion), talks a bit more with God & gets 10 commandments. In the mean time, the people decide that they want to worship someone else, so they make some golden calves. Moses comes back, gets mad, smashes the 2 stone tablets he had, grinds up the idols they made & makes them drink that in their water and stuff. Moses then gets things (more or less) in order & gets some new tablets & detailed instructions on how to build a tent (Tabernacle) for the Lord which is *really* fancy and they go wander around for quite a while, eating manna (which means "what is it?"). Some people at some point decide to challenge Moses for leadership (they figure they could find their way out of the desert in less than 40 years, or something?) but they lose & get swallowed up in a fissure from an earthquake or something. So they wander around for 40 years until the people who didn't think they could do it are all dead & the next generation then storms into the "Promised Land" and takes it over (again--their great grandparents had that land before, but others took it over while they were in Egypt).

      Then things are okay for a while, except that they're at war with a bunch of the other people around there. So God sends in a bunch of judges who do stuff. One of them had 40 sons who had 40 camels! Another one (Samson) beat up a bunch of people with a donkey's jawbone until they tricked him into cutting his hair. He got his revenge on them, though, by knocking down one of their temples when he was an old man & had been a prisoner of them for a long time (they had even put his eyes out!)

      Well, the judges didn't work too well, so the people asked for a king. God didn't like that idea, but gave them Saul anyhow. He didn't work out though & lost a battle he wasn't supposed to be in and so David took over. David did great, except that he had an affair with someone he saw taking a bath from the palace roof (Bathsheba). So he killed off her husband so he wouldn't complain. God didn't like this very much, however. Eventually, he had a son by her named Solomon who was very wise & succeeded him as king. Solomon did great as king (they actually had peace for a while!). He also built God a temple (David had wanted to do that, but God didn't let him because he'd been in too many wars). Solomon's son wasn't half as bright, though & wound up splitting them into Israel & Judah. Israel was 10 tribes, while Judah was only 2 and so Solomon's son now had 1/6 the kingdom he had before.

      After this, both halves have a whole bunch of bad kings who do bad things & a few good ones. God also sent a whole bunch of prophets, but people mostly ignored them. Eventually, God got sick of this & sent them all into exile in Babylon. Eventually, though, they got free again for a while & rebuilt God's temple with the help of some folks like Zerubabel (who also had a curse lifted off his family). Anyhow, the prophets did a lot of fun things in this time; one of them got swallowed by a whale (Jonah) and was distressed to see that the Ninevahites were more penitent than Isreal. Another guy saw a statue of gold, silver, bronze, iron & clay. There was also a bunch of other visions like the one with the fiery wheels (Ezekiel).

      Then we skip a bit of history in the Bible in what's called the "intertestamental period." There are books & stuff from this time, but not many are cannonical, at least, not to Protestants. The Catholics still read Maccabees & such (the KJV people *did* translate the apocrypha/deuterocannon, BTW, but some other folks decided they didn't like those books because they contained too much dogma or something, so they stopped printing them in Protestant bibles). In there, we find out that the Jews go into exile again at the hand of the greco-roman empire. They actually rebel successfully for a while (thanks to Judas Macabee) but then get crushed again. After this time, while they're still under Roman rule, this guy name Jesus, who is the Messiah is born.

      Anyhow, this Jesus guy escapes getting killed as an infant (not unlike Moses did), learns stuff from the priests in the 2nd Temple (first was destroyed, you remember), does a bunch of miracles & eventually makes the Pharisees jealous enough to put the Romans up to crucifying Him. Fortunately, Jesus had chosen 12 disciples (though one of them, Judas, betrayed Him) and so the 11 good ones & the extra guy they appointed later (Mathias?) carry on the good work after they find out that Jesus got ressurected.

      So they go all around, preaching the good news & driving Pharisees to distraction, including one guy named Saul who was really mad at them. But then Jesus tells Saul to quit it in a vision on the road to Damascus, so Saul does, gets baptised & changes his name to Paul, then goes on to write most of the NT. So they go on all kinds of missionary journies, heal people & stuff until Paul gets sent to Rome because after he created a fuss, he appealed his case to Caesar, as was his right as a Roman citizen. Of course, Caesar had him executed, but we don't really get to that part in the Bible itself; we hear no more of him after he goes to Rome. Also, this guy named John has this really long, cool, vision from God about Jesus coming back again & stuff which we call the book of Revelation.

      That pretty much sums it up for the Bible itself, though after this time was interesting, too. After revolts starting in 67 AD or so, the Romans smash the 2nd Temple (in 70 AD) and after a bunch more conflicts, they finally subjugate the Jews. The Christians (who were first called that in Antioch), OTOH, get martyred a lot, until they convert an emperor & pretty much take over the Roman empire, though it ceases to be a world power not so very long after that. The Jews get dispursed & the Christians have control of the Holy Land for a while, until this guy named Mohammad from Medina shows up, claims to have a message from God & tells his own story, completely unlike the one in the Bible. So he goes about raiding caravans & such, while trying to get rid of all the polytheists (infidels) in the area & eventually establishes Mecca as the capital of Islam with this really cool black rock thingy as a monument. He tells his followers to make sure they don't lose the original Koran, too, since he didn't like the fact that we had tons and tons of copies of the Biblical manuscripts, but no one knew of the originals (probably got lost in one of the exiles). Anyhow, eventually, a bunch of Moslems take over the Holy Land (they consider it holy too, after all), they get access to all the learning & technology of the ancient greeks & drive the Christians out of the area. So they undergo their own sort of Renaisannce, while the Christians have the Dark Ages. Then somebody gets the bright idea to take the Holy Land back from them, so they start the Crusades over many centuries and fight a lot. In addition to killing a lot of people & stuff, they find some of the learning of the Arabs & so they absorb it & eventually leave the Dark Ages & have their own Renaissance, the Age of Exploration & all kinds of other stuff which leads up to the world you know today :)

      So, that's my review of the Bible & the last two millenia or so :)

    11. Re:Next Up in the Obvious Category... by deaconBlue · · Score: 1

      Yeah, can I get a shout-out for my boy Knuth!

    12. Re:Next Up in the Obvious Category... by HamishLawson · · Score: 1
      I`ve never heard of it either. I`m not sure where people get off being smart arse and `Oh, i heard about it years ago`. So what? Someone told you sooner, that's all. Get over it.
      There's certainly no need for anyone to be a smart arse about it. And the book will probably continue for a while to be one of those that is mentioned far more often than it is read. But for the very reason of the book's numerous citations, I'd suggest to a professional programmer that they might want to consider whether they are reading widely enough if they managed to miss these references. I'd recommend Software Development magazine (sdmagazine.com) and Dr Dobbs' Journal (ddj.com) as good places to visit now and again to keep abreast of what's happening in the software-development world generally.
    13. Re:Next Up in the Obvious Category... by aWalrus · · Score: 1
      Maybe those models are not so common usage, but there are some in that book that should always be taught as part of every OO class in college, such as singleton and factory. I didn't know but passing references about patterns when I finished college, and in the work environment found these to be basic tools for a bunch of things we were developing, and thus became more interested in these issues.

      Want a database connection pool manager? try to do it without a singleton. Factories provide a lot of flexibility and extensibility to program modules. All in all, I think there are a lot of things any programmer can learn from this book and online resources of patterns.
      --

      --
      Overcaffeinated. Angry geeks.
    14. Re:Next Up in the Obvious Category... by pyrrho · · Score: 1

      think of the children... they havn't heard this yet.

      and besides, overexposure is how things become acknowledged classics. Really, this book should be mentioned yearly on any site where logicians might happen to wander by. I mean, think of the people that just by chance havn't heard of this (they were living in the underground cities, or the bottom of the sea or something)... and mostly, think of the children.

      --

      -pyrrho

    15. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0

      SlashDot: Community by perceived superiority

    16. Re:Next Up in the Obvious Category... by T3kno · · Score: 2

      door*jamb
      n.
      Either of the two vertical pieces framing a doorway and supporting the lintel. Also called a doorpost

      Maybe you should have continued programming, you might have then been able to afford a 2x4 for your doorjamb. Or you could have possibly continued on in school and realized that a doorjamb and a door jam are not the same thing at all.

      --
      (B) + (D) + (B) + (D) = (K) + (&)
    17. Re:Next Up in the Obvious Category... by kooshball · · Score: 1

      I was under the impression that the KJV was a somewhat biased translation because there was a fundamental tension between the anti-papist interpretation espoused by the protestant bishops who had agitated for the new translation and the scholars who were trying to please their new (and Catholic) king. The result is a translation that wavers between Catholic and Protestant dogma throughout the New Testament.

      Not that I'm a big bible reader, but I've always liked the approach of the New International Version (NIV). Get a bunch of biblical scholars and secular linguists together with all the accepted original sources and some apocryphal ones and translate everything to see where they agree. Then come to a consensus about how best to translate the parts that don't agree across sources. It seemed to work well given that a bible translated by commitee could end up reading like a poorly-translated motherboard manual.

    18. Re:Next Up in the Obvious Category... by rjamestaylor · · Score: 1

      Just like the difference between toe jam and toejamb! OUCH!

      --
      -- @rjamestaylor on Ello
    19. Re:Next Up in the Obvious Category... by Anonymous Coward · · Score: 0

      Whenever i`ve flicked through Dr Dobbs it always seems to be full of TLAs and other stuff that I can't ever see myself using. Its like a dictionary of the obscure. I`m not knocking it - I can imagine it being more use online, or in some other easily searchable form.

  9. Classic Geek Book by Anonymous Coward · · Score: 1, Interesting

    If you go into any room up in Waterloo and mention "Design Patterns", everybody in that rooms knows exactly what you're talking about. Its one of the Classic books around here. Expensive, runs about $75-$100 Canadian. Hard to find a used copy. And never in at the library.

    1. Re:Classic Geek Book by Abcd1234 · · Score: 2

      Bah, how's that expensive? I don't think I bought a text in University CompSci that wasn't at least $80, and I have a few that were in the $115-$130 range...

    2. Re:Classic Geek Book by gpinzone · · Score: 2

      Always compare prices before buying books. Here's a listing of the lowest prices from Addall.com.

    3. Re:Classic Geek Book by moseskiller · · Score: 0

      Since when has Waterloo university been a place for geeks ? In Canadian standards probably... I've met several graduates from there who really know no shit about development, had a few good laughs about this at the office.

    4. Re:Classic Geek Book by moseskiller · · Score: 0

      Since when has Waterloo university been a place for geeks ? In Canadian standards probably, but several graduates from there I've met knew really no shit about development, had a few good laughs about that at the office.

  10. a great, but dangerous, idea by ashultz · · Score: 5, Insightful

    This book is pretty great. It's also pretty dangerous, I've heard of idiots who rate the quality of any potential design by how many patterns it has in it.

    Design patterns is important for every OO programmer to read, understand, and hopefully transcend.

    1. Re:a great, but dangerous, idea by Luke+Skyewalker · · Score: 3, Informative
      I've heard of idiots who rate the quality of any potential design by how many patterns it has in it.

      Actually, a lot of the patterns overlap:

      The Singleton is a subset of Factory, and an Abstract Factory is a subset of Factory.

      Facades are Composites of interfaces.

      An Adapter is a type of Facade.

      (ad nauseaum...)

    2. Re:a great, but dangerous, idea by The+Cat+In+The+Hat · · Score: 1

      Yes, the world *is* full of idiots. But... I believe Grady Booch (we all know he knows nothing of design)states in the (Design Patterns) forward that one of the ways *he* measures oo design quality is by judging "... whether or not its developers have paid careful attention to the common collaborations among its objects" in short, *patterns*. Idiots are dangerous no matter what they are doing but the idea that design pattern usage is a good metric for judging oo design quality is hardly without merit.

  11. Beware of overusing patterns. by taeric · · Score: 5, Interesting

    Maybe overusing isn't the correct term, but definitely blindly using. I have seen far too many times (in far too short a time) where people will just start tossing in as many "patterns" as they can.

    Sometimes, as if to really horrify me, the reasons for including a pattern are to appease a manager!! This really frightens me, as the patterns are not discussed at the planning stage, but as an afterthought to implementation.

    Which brings me to a question. I have always viewed design patterns to be something that are used during the planning phase of a project. All too often, I am seeing where people start trying to shoehorn a design pattern into a project because they just heard about how great of a job it does at something. Does this happen elsewhere, or just with the projects I see?

    1. Re:Beware of overusing patterns. by fruey · · Score: 2

      Of course. I once had a client, after a project was finished and in management validation for going public, suddenly go to www.commentcamarche.com or equivalent (www.howstuffworks.com is the anglophone site of similar nature) and pick up something about quality control and project management and suddenly start changing everything, including our reports, into terminology and methods he'd read the night before. A nightmare, since everything had *already* been managed reasonably and was working to boot!

      --
      Conversion Rate Optimisation French / English consultant
    2. Re:Beware of overusing patterns. by dnoyeb · · Score: 2

      This usually happens when management changes.

    3. Re:Beware of overusing patterns. by Viking+Coder · · Score: 2

      I have always viewed design patterns to be something that are used during the planning phase of a project. (Emphasis added.)

      Design and planning are partners in crime. Trying to use design patterns "as an afterthought to implementation" is a really bad idea.

      I really laughed when I read your post, because I imagined another book, "Kludge Patterns." When you're well past the design phase on your application, and the damned thing doesn't work, abandon Design Patterns and riffle through the pages of Kludge Patterns looking for some clever hack that can save the day... =)

      --
      Education is the silver bullet.
    4. Re:Beware of overusing patterns. by richieb · · Score: 2
      Which brings me to a question. I have always viewed design patterns to be something that are used during the planning phase of a project.

      Are you a coder or a planner?

      In the "real world" (tm) there is no clean separation between the "design" and the "planning" phase - because things change.

      In real projects things happen iteratively - you design and code a little, see how things are going, then amend the plan, and go back to coding. In between you ask the users to see if they thought of new requirements.

      Google "Extreme Programming".

      --
      ...richie - It is a good day to code.
    5. Re:Beware of overusing patterns. by MSBob · · Score: 2
      Even worse is people assuming that all patterns are good for is what is discussed in the book's examples. For instance, most developers can only apply the bridge pattern to GUI development because that's the example GoF used in their text. It's pretty sad that people find it so hard to translate one problem domain to another.

      The other danger of patterns is that certain developers only understand a couple of them really well and they become their 'favourite' patterns. Then every piece of code they touch has to implement one of their three pet paterns. And god forbid if one of those patterns is a 'Singleton'...

      --
      Your pizza just the way you ought to have it.
    6. Re:Beware of overusing patterns. by Anonymous Coward · · Score: 1, Insightful

      Two books spring to mind: "Antipatterns" and "Refactoring".

      Antipatterns has a catalog of commonly occuring design mistakes and problems found in code. Like Lava Flow where layer upon layer of code has been squeezed into the same module Or God Class where one class controls and is coupled to everything else in the project. Bad programming practice can be classified just like good practicce.

      Refactoring is all about how to fix design errors during coding. It places a strong emphasis on Unit Testing and is popular with the XP crowd. When faced with a problem in design during the implementation phase its never a good idea to kludge your way out of it. Use the controlled, testable processes described here to improve the design throughout the whole project.

      None of these books should be restricted to the "planning phase" of the project. Rather revisit your original ideas and assumptions as your project progresses. If you find you've taken a wrong turn don't kludge it into an Antipattern, rather Refactor it into a better solution, using your suites of unit tests to ensure backward compatiblity with what you have already done.

    7. Re:Beware of overusing patterns. by Luke+Skyewalker · · Score: 1

      Actually, what really kills projects is the reluctance of managers to allow designers to step back and redesign the existing architecture. Sometimes a pattern turns out to be more of a handicap than a benefit, and in an ideal situation, you would step back and redesign that part of the architecture.

    8. Re:Beware of overusing patterns. by taeric · · Score: 2

      This reminds me of why I despised the CS department in college. They thought that they were a completely unique subject that had to be taught completely differently then any other subject. What was the result? They were having to learn lessons that every other department had learned years ago. That is the one thing I absolutely loved about the Design Patterns book, the fact that they took cues from other disciplines

      So.. First off, There is no "real world." Anyone who uses that phrase is often about to explain an excuse for why they do something the way they do.

      However, I was not saying that I think there is an exact point where planning ends and coding begins, but they should be at least sheilded from each other.

      If somebody comes in with a whole new pattern of approaching a situation, perhaps they should realize they either never had a pattern (or plan) of approach before, or that they should finish the first approach. If it is the former, that is the problem. If the later, well, suck it up and finish it.

      Too many times you get people who think they should immediately apply the latest and greatest approach to a project that is still in the implementation phase of an older approach. That is a horrible mistake for people to make.

    9. Re:Beware of overusing patterns. by EvlG · · Score: 2

      People do the same thing with XML too...

    10. Re:Beware of overusing patterns. by eduardodude · · Score: 1

      Sure, it happens and I've seen it too.

      But what happens far more often in my experience is that people just jump into a design without doing solid analysis of the problem, which is where it often becomes obvious where certain patterns have something to offer.

      You're right that the goal shouldn't be "pattern density" so much as just solid design.

      The scenario you describe may be comical, but the fact that they were even aware of patterns and could recognize areas where they might possibly be useful means they were probably more savvy than most.

    11. Re:Beware of overusing patterns. by piobair · · Score: 1

      On the flip side fitting a problem that exhibits 90% of the charastics of a pattern helps hugely in future maintenance. That is, of course, if the maintainer is well-versed in patterns.

      Remember, a pattern is a solution in a context what may look like gratuitous use of patterns may actually be a proper analysis of the context and some amount of compromise for maintenance.

      This is a very sketchy and philosophical subject. I've got the underpinnings of a book in progress on this, but so far its more of a philosopy text than a CS book.

      Maybe some day I'll sort this all out.

      --
      I have a second sig, I call it sig#2.
    12. Re:Beware of overusing patterns. by mOdQuArK! · · Score: 2
      Are you a coder or a planner?
      In the "real world" (tm) there is no clean separation between the "design" and the "planning" phase - because things change.

      Actually, it's this whole viewpoint why I think Design Patterns & Refactoring go together like PB&J...

      One of the reasons why I like working with other people who also understand design patterns is because it simplifies a LOT of communication - instead of having to repeatedly describe an entire architecture, you can just say "I used the Abstract Factory pattern, and these are the names of the relevant objects", and then everyone knows what you're talking about (and can sanity check your code in a review to tell you if you violated the pattern somehow).

    13. Re:Beware of overusing patterns. by my_furry_butt · · Score: 1

      Christopher Alexander et al (who wrote A Pattern Language, which inspired the GoF to write Design Patterns), stated that one could create a design by 'stringing' patterns together, but that that the result would be 'loose' and unsatisfying. The GoF themselves state that sequentially applying patterns is probably inappropriate as well. Alexander then states that designs that feature overlying and complementing patterns in the same space result in 'a profound effect'. The GoF agree with this too. However, it is implicit that inappropriate overlying or coupling will result in somethind 'profoundly bad'.

      OTOH, one of the original authors of 'A Pattern Language' was a guy called Schlomo Angel, which sounds like a character from Get Shorty, rather than a figure to draw ideas for s/w architecture from!

      --
      It's not the depth of the water thats the problem. It's the current that kills you.
  12. Great book, goes well with .... by goodviking · · Score: 3, Insightful

    This is a fantastic book. It is probably the best book out there for coverage of all of the fundamental design patterns. The examples are in Smalltalk and C++, and are readable and easily translatable to other OO langs (Java, C#, ...).

    I would recommend that along with this book, you take a look at Pattern-Oriented System Architecture. It applies the design pattern concept to problems in large scale system architectures.

    A combination of the techniques in both of these books can really help unwind alot of the spaghetti problems at both a system and component level. Additionally, alot of the fundamental concepts in modern system architectures become alot clearer once you've read both.

    1. Re:Great book, goes well with .... by psychofox · · Score: 1

      No wonder you'd recommend it... probably because you'll get a referal fee for each person who buys it after clinking on the handy link you've supplied.

    2. Re:Great book, goes well with .... by goodviking · · Score: 2

      Interesting, some company that I have absolutely no business relationship with (never bought anything, never registered) and whose site I just went to and searched on a book title is now going to start sending me checks.

      Thanks Mr. Illuminati, this here internet thingy sure does rock!

      * Sigh *

      If it makes you feel any better, here's another link to the book from the publisher. In my opinion, the barnes and noble link has more info, but this link might be less offensive. If you really want my bookstore marketing plug, I say buy the book at one of these locations and help keep independent booksellers alive. Regardless of your interesting take on my motives, it really is a fantastic book and is worth a look.

  13. No pattern experience required by cheezfreek · · Score: 5, Interesting
    Even with little previous exposure to patterns, I was able to understand the presented material easily and begin to see the applications.

    Even with no exposure to patterns, I was easily able to understand this book. This book was my first exposure to patterns, and I don't think I could have had a better introduction to the subject. I highly recommend this book to anyone who knows anything about object-oriented design.

  14. Only shit coders read books like this by Viol8 · · Score: 0, Troll

    The sort of people who read these books are the sort who normally couldn't code their way out of a paper bag. Ask them to write a low level device driver or network protocol and they'll piss their pants , but ask them to write some high level description of some GUI front end using as many buzzwords as they can shoehorn into the design document and they're in their element. And this is one of the books they'd have sitting on their shelf. Its a comfort blanket for people who kid themselves they're programmers but in reality are designers who should never be let near any C++ compiler. Is it any wonder with modern day management trumpeting this kind of rubbish that afar greater percentage of IT projects overrun, are overbudget and don't meet the spec than ever before?

    1. Re:Only shit coders read books like this by Anonymous Coward · · Score: 3, Insightful

      uh, no. Authors of C++ device drivers are not the only "real" coders. I've risen far up the ranks in my career writing database apps with quality, intuitive front ends. My apps are well-designed, have few bugs, and solve numerous tasks that could not have been solved before I wrote them. The end users love me, and I'm well-compensated for what I do. I currently could not (nor wish to) write a low-level C++ device driver. Bleah.

      Anyway, if you've got to write a low-level device driver, why are you using C++ at all? Get down to assembly level and do it right!

      There are different types of problems out there that need solving. This book addresses ways of solving many of them.

    2. Re:Only shit coders read books like this by russellh · · Score: 3, Funny

      Yeah. Mere coders shouldn't be reading books like this, lest they risk being distracted by a glimpse the big picture.

      --
      must... stay... awake...
    3. Re:Only shit coders read books like this by Anonymous Coward · · Score: 0

      Anyway, if you've got to write a low-level device driver, why are you using C++ at all? Get down to assembly level and do it right!

      because maintainability and portability are valuable in device driver code? oh, i guess you wouldn't know about that, being an applications programmer. ahem.

  15. Who Actually USES These Patterns? by sqlzealot · · Score: 2, Interesting
    When I was taking CE courses design I was fascinated by the Design Patterns book. I thought it would take OOD concepts one step further and offer a new framework for software development. I went out and bought the book, and while it was very interesting, I never really thought that I would be in a position where I could use any of the patterns.

    They seem overly complex, and although they try to be general, I can't imagine that they could be easily adapted to any but a few (large) software projects. I don't have enough good examples, but I get the feeling that every major software project will come up with its own "design patterns", and they probably bear little resemblance to the ones in the book (and will be a lot simpler as well). My wife likes them, and she thinks that they provide a common vocabulary for developers to use in developing their own patterns, although I am not convinced.

    What has been the experience of /.ers who actually use this book in their (non-educational) software development projects?

    --
    "Overhead, without any fuss, the stars were going out."
    1. Re:Who Actually USES These Patterns? by Viol8 · · Score: 0

      Virtually no one. I've been in the industry 10 years in banking and the scientific fields and I've yet to see any real programmers using this sort of stuff. Its written for ivory tower academics and students mainly.

    2. Re:Who Actually USES These Patterns? by Vengeance · · Score: 5, Informative

      I use patterns on a regular basis, at many levels of code. The best description I've seen for why we want to use design patterns actually came across my desk this morning. If two woodworkers wish to describe joining two pieces of wood together for the front and the side of a drawer, they COULD, I suppose, discuss cutting a certain length, turning at a certain angle, cutting another length, turning the other way again, etc. etc. ad nauseum. OR, they can simply indicate that they want to use 3/8"-wide through dovetails.... Concise, and providing just as much information to the informed. What happens is that there is meta-information underneath the words being used, conveying more than the casual observer might catch. When discussing whether to use one pattern or another, it's akin to deciding whether you wish to use dovetail or mitre jointing for that corner. When you write code, you're already using patterns behind the scenes anyway. It's nice to know what you're doing, and it's REALLY nice to have a shared vocabulary for this stuff.

      --
      It was a joke! When you give me that look it was a joke.
    3. Re:Who Actually USES These Patterns? by oops · · Score: 5, Informative

      Any good OO programmer/architect I know will speak in terms of patterns. eg. conversations I had yesterday went like:

      Can't you use a singleton here ?


      or

      Perhaps we need a strategy mechanism

      and so on / so forth. As soon as people talk in terms of patterns, they're talking at a level of abstraction above basic objects, and at a level where you're talking about object construction and interactions. Whenever I see someone's CV claim to have knowledge of OO, pattern knowledge is the next thing I look for. It means that we can talk in common terminology and have a common 'toolbox' of solutions to use.

    4. Re:Who Actually USES These Patterns? by brw215 · · Score: 1
      I am developer in industry who works building large OO systems, and we use many of the design patterns listed in the book. Some are more useful then others, but many of them are invaluable. These patterns provide a basis for using OOP to solve common problems, such as isolating subclasses etc....

      I wonder if the developer who responded to your list has ever used an OO language in industry, because I can tell you that the majority of professional developers I know all have this book on their shelves.

    5. Re:Who Actually USES These Patterns? by Anonymous Coward · · Score: 0

      Wow - I pity the people who have to maintain your code! People who want to write clear, maintainable, functioanl code quickly use patterns all the time in "the real world". People who want to write crud, don't.

    6. Re:Who Actually USES These Patterns? by SquirrelCrack · · Score: 1
      The only one I see in regular use is the Model View Controller pattern.
      This is used pretty heavily (at least in the early phases of the project) by many larger java appserver based web projects.

      One of the problems that happens with real world projects, is scope creep. As the project outgrows the original requirements, programmers are more likely to hack outside of the architecture originally laid out.
      As a result many patterns that are laid out at the beginning of a project are poorly (or not at all) used by the end of the project.

    7. Re:Who Actually USES These Patterns? by wurp · · Score: 2

      As a C++ and Java developer (7 years dev experience), I use several of the patterns very frequently. In order of usefulness in my career:

      Composite pattern
      Iterator!! (used in STL and Java Collections)
      Singleton
      Proxy (used implicitly in Java RMI)
      Prototype factory
      Adapter
      Observer (Java listeners, document-view architecture)
      Template method (used basically any time you do polymorphism)
      Decorator

      I'm astounded that people with OO design experience who've read the book can claim that they don't use the patterns! Several of the patterns are more esoteric, but I would have to say I have used virtually every pattern in the book at one time or another.

    8. Re:Who Actually USES These Patterns? by tequesta · · Score: 3, Insightful
      Banking and Scientific Computing are hardly leading innovators when it comes to software design (COBOL, anyone? FORTRAN, anyone?) But apart from that, it is my firm belief that any programmer worth her/his wages uses patterns. They may not be the actual patterns portrayed in the Gamma book, but they're patterns nonetheless.

      The main good thing about this book is not that it lists a lot of patterns, but rather that it teaches you what a pattern is. This is truly a mind-altering experience. Once you grok the concept, you see patterns pop up all over your own code! Then you can extract and refine their specialties, encapsulate them and re-use them again and again.

      This, besides saving you a shitload of future work, teaches you entirely new ways of thinking about object-oriented programming. I've talked to a lot of people who found that reading this book is truly a mind-blowing experience in that respect. Certainly changed my coding.

      And the specific patterns in the book are kind of cool, too.

    9. Re:Who Actually USES These Patterns? by Viol8 · · Score: 0

      Yeah , I'm sure Linus used patterns all the time when he was writing that "crud" known as the Linux kernel. Hello , this is earth calling , come in please Major Tom...

    10. Re:Who Actually USES These Patterns? by pamar · · Score: 1

      Virtually no one. I've been in the industry 10 years in banking and the scientific fields and I've yet to see any real programmers using this sort of stuff. Its written for ivory tower academics and students mainly.

      I suppose you should qualify your experience a little better, before issuing such opinions. I suspect that you either use non-Object Oriented languages, or have failed to recognize some of the solutions you encountered as a classic pattern.

      If you do work with OO tools and a DB, I really doubt you never used at least a couple of the basic patterns (especially Singleton).

    11. Re:Who Actually USES These Patterns? by Viol8 · · Score: 0

      Actually we use C++ and Java at my current place , plus genetic algorithms. If any programmer was clueless enough that he needed to read a book like this before he could write decent code then we wouldn't hire him. We want people who can think for themselves , not just regurgitate what they've read in some Dummies Guide to Software Design type book.

    12. Re:Who Actually USES These Patterns? by Ripplet · · Score: 1

      I have used these on many projects (admittedly mostly large ones). For a lot of common design problems, you simply need to look in the book and there is your answer. It is now second nature to me to use, for example, factories for creating families of objects where the end client doesn't actually need to know the concrete type of object it is using.
      There are some patterns, or derivatives thereof, that are found on nearly every project I have worked on in the last five years, e.g. singleton, observer.

      It's important to remember that the authors stress that these are not designs that you might think of the first time you go through a problem, especially if you are relatively new to OO. Therefore what may seem a strange design at first, may suddenly click into place when you really analyse it in the context of your particular problem.

      It's basically a case of "suck it and see". If you have a problem, check out the book to see if it's helpful.

      >every major software project will come up with its own "design patterns"
      This is true, but every major software project will also come up with similar problems to a lot of other major software projects. That is where this book helps.

      --

      Skiing? Check out The Independant Skiers Portal

    13. Re:Who Actually USES These Patterns? by Houdini91 · · Score: 1

      I went out and bought the book, and while it was very interesting, I never really thought that I would be in a position where I could use any of the patterns

      How can any programmer state they were never in a position to use any of the patterns described in Design Patterns?

      Have you ever made an instance of a class global? Then you could have used the Singleton Pattern to avoid polluting the global namespace while giving your program more control.

      Or ever wanted to make something cross platform? The Bridge Pattern is the perfect choice.

      Did you ever wish C++ supported class member callbacks? Then use the Command Pattern.

      Have you ever used the STL? Then I'm sure you've probably used the Iterator Pattern.

      Have you ever wished your application supported plugins to allow your users to enhance your application? The Abstract Factory + Bridge Pattern works wonders.

      Heck, if you've ever worked with any populer GUI toolkit (QT, MFC, etc) then you've already used the Observer Pattern (a derivitive of the MVC Pattern).

      Design Patterns is an absolute gem of a book for writing object oriented programs.


      - Houdini

    14. Re:Who Actually USES These Patterns? by cmpalmer · · Score: 1

      Just reading the book gave us not only insights into new methods but also terminology to talk about what we had been doing all along.

      Our company does a lot of development in VB (boo hiss? bite me, we like it) and we consciously apply many Design Patterns in our software.

      --
      -- stream of did I lock the front door consciousness
    15. Re:Who Actually USES These Patterns? by gandalfy · · Score: 0


      Who reads books anyway?

      Let's re-invent the wheel!

    16. Re:Who Actually USES These Patterns? by Houdini91 · · Score: 1

      I absolutely agree. At our work nobody has ever picked up a C++ book or even taken any classes on programming. We all just knew how to program, and how to write maintainable, readable, and reusable code.
      Kids now-a-days...

      - Houdini

    17. Re:Who Actually USES These Patterns? by tequesta · · Score: 1

      You're missing the point. First, merely using C++ or Java does not mean you're writing object-oriented code. You can have objects all over the place and your code is still not object-oriented.

      Second, I personally know lots of programmers who get by (and certainly don't need any Dummies' Guides). Pitiably few of these (three, actually) grok OOP. This is just personal experience and not in any way statistically relevant, but from the sorry state of available software, I'm led to believe that not just the programmers I know could use a hit from the clue bong. If your employees are much better than that, good for you.

      Third, this is not a Dummies Guide to Software Design. This has been groundbreaking work when it was first published, and still is today.

      Fourth, you obviously haven't read it. You may want to give it a try.

    18. Re:Who Actually USES These Patterns? by PeterHammer · · Score: 1

      I guess you never took the time to inspect the source code for the Java libraries? Many of the patterns used therein are exact applications of the patterns described in this book.

      For that matter, the XML libraries created by Apache.org, SUN and others for the Java platform use the factory pattern extensively to ensure that parsing tools can be interchanged.

      Maybe you need to branch out a little and look at the real programming world circa 2002. When you code modules that are flexible and can be used by programmers in any industry, chances are you are employing many of the concepts exposed in this book.

    19. Re:Who Actually USES These Patterns? by Viol8 · · Score: 0

      Its a high level book. It does not teach programming. Anyone who needs to read this sort of book to become a good programmer has ability issues. What point are you missing exactly?

    20. Re:Who Actually USES These Patterns? by fitten · · Score: 1

      Device drivers and operating systems in the past have typically been some of the most hacked up, ugly, unmaintainable, spaghetti code ever seen. Don't confuse device drivers and OS code with application software. The two are not even close to being the same.

      Also, don't base your whole outlook on life (and coding) by the actions/example of one human. The only thing that Linus did that was truly remarkable was to give his OS source away free and encourage anyone in the world to dork with it. There have been *many* operating systems written, some (believe it or not) better, faster, and/or more stable than Linux.

    21. Re:Who Actually USES These Patterns? by gandalfy · · Score: 0


      If learning well designed solutions to common problems instead of spending ages making your own solutions is an ability issue, then alot somone has things mixed up.

      No one is ever finished learning about programming, either it is the intricacies of C++ or programming theory. There is always more to learn. If you don't think so, then you have some issues of your own :)

    22. Re:Who Actually USES These Patterns? by Tupper · · Score: 1
      Few of these patterns were new to me, but that doesn't mean they are unimportant. Having a standard jargon (aka techspeak) is very valuable. The jargon helps with communication which leads to more (productive) conversionsion which leads to better designs. "I used a chain of Decorators produced by an Abstract Factory similarly to what we did in project foo" says alot to a coworker and leads directly to the interesting bits--- where this project is different and why. Its also helpful when implementing a pattern rarely used to go and look up the implementation issues in this book and see if any have been overlooked.

      Also, patterns are fun.

    23. Re:Who Actually USES These Patterns? by mav[LAG] · · Score: 2

      As soon as people talk in terms of patterns, they're talking at a level of abstraction above basic objects, and at a level where you're talking about object construction and interactions.

      This also helps when you're trying to wrap your head around a library written by others. Some of the clearest and best use of design patterns I've seen is in the Open SceneGraph library. Although a little short on tutorial docs, the code is so well designed (including naming!) from a patterns point of view that you can pick up what the various classes are doing very quickly.I wouldn't quite recommend it to a beginner in patterns but for someone looking at exactly how they are used in the real world, it's great code.

      --
      --- Hot Shot City is particularly good.
    24. Re:Who Actually USES These Patterns? by Drazil · · Score: 1

      My employer (also the senior developer) has a similar view on pattern-oriented development (i.e. that its reserved for academics). From bitter experience I can say that his aversion to software patterns is expressed in his poor design choices and cryptic code.

    25. Re:Who Actually USES These Patterns? by HeyLaughingBoy · · Score: 1

      I'm taking a course on Patterns & Architectures right now, and while I haven't actually designed anything (outside of class, that is) which was planned to use patterns, after reading the book I recognized that I had used some of these patterns in my previous work without knowing what they were called. Patterns exist in a wide spectrum of domains and levels of complexity. There are patterns for enterprise-wide architecture and patterns for tiny embedded systems (the paper, "A Pattern Language for Simple Embedded Systems" comes to mind).
      Now that I have a wider background in patterns, I can see even more opportunities for use in my day to day work as a SW engineer. I agree with your wife!

    26. Re:Who Actually USES These Patterns? by 0x457269 · · Score: 1

      I remember one meeting with a couple of developers who described a really powerful feature they were coding. This included complex diagrams of what the system did, and a number of worked examples.

      After about half an hour of this I clicked and asked "You mean you are using the composite pattern?" -- perplexed silence, and finally a nod and a "Yes". So one can use patterns to describe in 3 seconds which otherwise would take over half an hour.

      By the way, since then I have learnt to suffer attemps at intellectual intimidation much more diplomatically :-)

    27. Re:Who Actually USES These Patterns? by Viol8 · · Score: 0

      Yes, and they didn't use patterns either. YOu think they were used in the design of the original unix, vms , os400 , macos? Get real. And I agree OS and app software and not close to being the same , OS software is a damn sight harder to write.

    28. Re:Who Actually USES These Patterns? by Houdini91 · · Score: 1

      That's the dumbest argument I've ever heard, Viol8. Just because it's possible to write applications or operating systems without using patterns doesn't mean that it's better to write them without using patterns.


      - Houdini

  16. this book is out of date by Anonymous Coward · · Score: 0

    Most of the stuff in the design patterns book was interesting to look at 5 years ago when the book first came out.

    You would be better off now to read through the JAVA class documents.

    Design Patterns that are published in a book like that lag the real practices of the software industry by many years.

    Folks who work in software lead the industry, they don't live in the publishing houses or in the ivy covered hallways of money mongering corporate universitys.

    Ya, That book was cool a few years ago. Now it is OUT OF DATE. Don't pay full price for that one.

    1. Re:this book is out of date by Ripplet · · Score: 3, Informative

      >Most of the stuff in the design patterns book was interesting to look at 5 years ago when the book first came out.
      And is still perfectly relevant. Writing SW hasn't changed that much in the last 5 years.

      >You would be better off now to read through the JAVA class documents.
      This may help if you want to know how to write a nice class, but patterns are about getting good interactions between classes, they look at things at a much higher level of abstraction. This is one reason why they can add to a programmer's vocabulary.

      >Design Patterns that are published in a book like that lag the real practices of the software industry by many years.
      And they have been superceded by what exactly?

      >Folks who work in software lead the industry, they don't live in the publishing houses or in the ivy covered hallways of money mongering corporate universitys.
      Oh, and they never talk to each other? If I think I'm leading the industry, how do I go about spreading my fabulous ideas? Hey, maybe publishing a book would be a good way?

      >Now it is OUT OF DATE.
      No it is NOT. All the ideas are still valid, all the problems are still around, and the basic concept of patterns has spread enormously, so that now you get anti-patterns, analysis patterns, project management patterns etc. etc.

      --

      Skiing? Check out The Independant Skiers Portal

  17. Overdesigning by archeopterix · · Score: 1
    This book is pretty great. It's also pretty dangerous, I've heard of idiots who rate the quality of any potential design by how many patterns it has in it.
    Yeah, keep it out of reach of your Pointy Haired Boss. It hasn't been proven but it's a scientific fact that reading this book was the direct cause of Skinnable Interfaces - the top 20th century misfeature.
    1. Re:Overdesigning by Tim+Browse · · Score: 2

      It hasn't been proven but it's a scientific fact...

      Sorry, I just wanted to see that assertion on its own, just to see how stupid it looked :-)

      Tim

  18. Important point that the review might have missed. by eddy · · Score: 5, Informative

    What the review missed to point out (okay, I only gave it a once over..) is one very important aspect about patterns and this book in particular; it gives developer a new common language to use when communicating about software design.

    For instance, you might have 're-discovered' the visitor pattern yourself and used it several times, but without the nomenclature of this book it was very hard to actually talk about that design with other developers.

    Great book, one of few that - after reading it - got me all exited about development again.

    --
    Belief is the currency of delusion.
  19. How's a link to a comment of THIS article offtopic by Anonymous Coward · · Score: 0

    wtf?

  20. antipatterns by Aniquel · · Score: 5, Informative

    If you read Design Patterns, the next book to read should be AnitPatterns: Refactoring Software, Architectures, and Projects in Crisis (ISBN: 0471197130). Design patterns shows you what to do, Anitpatterns shows you what *not* to do (and how to fix it if its already fscked up).

    1. Re:antipatterns by Anonymous Coward · · Score: 0

      Thanks for the tip, I'll get AnitPatterns.
      I see too much of "good software practice"
      which too often means bloated slow code.

    2. Re:antipatterns by Anonymous Coward · · Score: 0

      No you shouldn't read "AntiPatterns": it's nearly unreadable, as is "Software Architect Bootcamp" by two of the same authors. The writing in both books seemed like a first draft by an untalented writer.

    3. Re:antipatterns by hawkfish · · Score: 1
      and how to fix it if its already fscked up

      There is at least one place in AntiPatterns where they advise you to get another job if you see a particular problem. Which is often the best way to fix some things!
      --
      You will not drink with us, but you would taste our steel? - Walter Matthau, The Pirates
  21. Error on Search MF by Anonymous Coward · · Score: 0

    HTTP/1.1 200 OK Date: Tue, 05 Nov 2002 15:53:22 GMT Server: Apache/1.3.26 (Unix) mod_gzip/1.3.19.1a mod_perl/1.27 mod_ssl/2.8.10 OpenSSL/0.9.6g X-Powered-By: Slash 2.003000 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1

  22. The is the bible of OO design by brw215 · · Score: 1
    This book is the magna carta and all other OO design pattenr spring form the ideas launched by the Gang of Four. The big problem with this book is that examples are horrible. The constantly use maze examples which make no sense. It also makes thew patterns appear to be useless for real world applications, which they most certainly are not.

    For java developers I would strongly recommend reading this book in conjunction with Sun's applied Java patterns book.

    1. Re:The is the bible of OO design by ChaoticChaos · · Score: 1

      I have to totally agree with this. I read this book but could not make sense out of much of it because the authors are using patterns to make a maze-based game.

  23. This is a first by RedWolves2 · · Score: 2

    bn.com actually beats out Amazon by $10.
    Design Patterns[associate] is $54.99. Compared to $44.95 at bn.com.

    Go ahead and click on Slashdots link.

    1. Re:This is a first by diesel_jackass · · Score: 2

      Although Amazon does have "Used & new" from $37.95. Which is $7 less than bn.com.

    2. Re:This is a first by Anonymous Coward · · Score: 0

      Or Bookpool for 42.50.

  24. ya, I couldn't talk till I saw that book by Anonymous Coward · · Score: 2, Interesting

    Most of that stuff in that book is trivial.

    Anyone who does real development was using these patterns years before the book came out.

    Books like these are catelogs of other people's ideas and put into a standard format. It is like saying that noone could breath oxygen before the perodic table of the elements came out. Obviously oxygen was around for ever. The patterns in this book are DESCRIPTIONS of other peoples work. It was the method of presenting the ideas that seemed new at the time.

    But when it comes right down to it JAVA or C++ classes do a much better job of documenting good design patterns for programming.

    The idea of Design Patterns is probably something developed by patent mongerers. They take very simple and trivial ideas and make them seem important by putting them in a common format. Big deal.

    You'd be better off reading working code than wasting your time on a five year old book that documents 15 year old ideas.

    1. Re:ya, I couldn't talk till I saw that book by borgboy · · Score: 3, Informative

      Sure it's trivial. Much like the "trivial" civil engineering concept that a bridge built with too little concrete will fall down.

      Certainly, anyone who does "real" (as opposed to integer?) development will have discovered many, if not all of these patterns. Why wait years, when you can read about them? Patterns are studied in architecture - and humans have been building structures far far longer than they have been crafting software.

      Sure it's a catalog. It's also a lexicon. Does that invalidate it's utility? This is the kind of work that will help push software development into a estimable science instead of the craft it largely is today.

      Java(tm) and C++ and are excellent ways to document implementations of systems. However, a design pattern is intended to be an abstraction that can be applied to ANY language. That way, a Smalltalk developer can say "Strategy" to a Java(tm) coder and they both share the appropriate context.

      You seem rather hostile about this book, resorting even to ad hominim attacks upon the GoF, who have separately and collectively done a great deal to advance OOP. Perhaps you regret not having written down these obscenely trivial ideas yourself and peddling your own brand of software snake oil.

      --
      meh.
    2. Re:ya, I couldn't talk till I saw that book by Get+Behind+the+Mule · · Score: 3, Informative
      Holy mackerel, you have completely misunderstood.

      Anyone who does real development was using these patterns years before the book came out.

      Books like these are catelogs of other people's ideas and put into a standard format.


      Exactly right. That's what the whole idea of documenting patterns is about. A pattern is always something that has been done before, never an experiment. People who document patterns are not inventing them (because an invention cannot be a pattern); they are identifying and naming successful structures and ideas that were not well recognized until then.

      The advantage is simply that we often don't see these things until they are named and described. We use them unconsciously, but may not recognize when there is an opportunity to re-use them, may not have thought carefully about when it is and is not advantageous to use them, and don't have the vocabulary to communicate them to other programmers.

      It is like saying that noone could breath oxygen before the perodic table of the elements came out.


      No, it's like saying we always had oxygen all around us, but it didn't have a name and no one really understood its properties until Lavoisier discovered it.

      But when it comes right down to it JAVA or C++ classes do a much better job of documenting good design patterns for programming.


      Uh, are you aware that some of the Java library classes were specifically built to implement Gang of Four patterns? Look, for example, at the Observer class and Observable interface from java.util.*; does that remind you of anything?
    3. Re:ya, I couldn't talk till I saw that book by Anonymous Coward · · Score: 0

      Actually, Smalltalk programmers don't talk to Java "programmers".

    4. Re:ya, I couldn't talk till I saw that book by borgboy · · Score: 2

      Tell that to Kent Beck

      --
      meh.
    5. Re:ya, I couldn't talk till I saw that book by edhall · · Score: 2

      You probably think design meetings are a waste of time, too. Well, with common nomenclature such as presented in this book, those meeting are less of a waste of time. And I find those little "meetings" that occur in my head when I'm thinking about the design of a program I'm working on are more productive, too.

      -Ed
  25. Overrated by timeOday · · Score: 1, Insightful

    The book is worth looking at, but both it and design patterns as a whole are nothing much. It's hard to push through design patterns books, because most of the patterns will be familar to you already if you've done some design and/or used various frameworks and toolkits. The innovation of the design patterns book/movement is simply to give names to common design elements so they can be discussed. This is useful, but not a breakthrough of any sort.

    1. Re:Overrated by robbo · · Score: 1

      I agree completely, not to mention with the reviewer's comments about the UI emphasis. I've written several tens of thousands of lines of C++ code, most of it while DP sat comfortably collecting dust on my bookshelf. When the patterns aren't obvious to the intelligent designer, they deal with gluing objects and GUI's together which, granted, is an important task for many apps, but not for solving basic computational problems.

      Insert obvious cliches about square pegs, round holes, big hammers and everything looking like a nail here.

      --
      So long, and thanks for all the Phish
  26. The real value of Slashdot by Anonymous Coward · · Score: 0

    Book reviews!

    Where else can I get unbiased reviews of the latest programming techniques?

    Outstanding job Taco! Keep up the good work!

  27. Hell no by PissingInTheWind · · Score: 4, Insightful

    [...] little changed from 1992! In the computer field this would be considered an ancient text with how fast software is updated and languages change.

    Holy shit no. 1992 isn't 'ancient' in any way, only for people with very short memory and attention span. Or for people who thinks XML is a neat new idea. Or for people who thinks Java OO-model is a neat new idea. Or for people who thinks Patterns is the new silver bullet. Or for people who thinks Lisp is dead.

    Hope you get the idea.

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
    1. Re:Hell no by ckimyt · · Score: 1
      Holy shit no. 1992 isn't 'ancient' in any way, only for people with very short memory and attention span. Or for people who thinks XML is a neat new idea. Or for people who thinks Java OO-model is a neat new idea. Or for people who thinks Patterns is the new silver bullet. Or for people who thinks Lisp is dead.

      A bit "fsck yeah" to this.

      I saw the latest poll (best "breakthrough" in programming) and some of the posts declaring missing options (AOP, FSF, etc.) and thought..."gee, with Lisp I can choose ALL of the above."

      It still makes me wonder why so many people (i.e. MASSES) think Java or XML are just amazing.

      --

      Putting the sig back into +1, Insightful since 1995!
    2. Re:Hell no by Anonymous Coward · · Score: 0

      It still makes me wonder why so many people (i.e. MASSES) think Java or XML are just amazing.

      Because those who knew better probably bailed IT and went into banking or something. IOW, bad fads filter for idiots. Write a vaporous book called "XML Pattern Objects" and sell millions. Have some 1999 VC's help with the writing.

  28. ya, a freshman in highschool should breeze this by Anonymous Coward · · Score: 0

    good book for a highschool programmer to breeze through in a few minutes.

    Better, start cutting code and see what actually works. Pretty headers and large fonts with the name of some trivial idea don't cut it in my world.

    I want CODE that WORKS. Not some big thick and EXPENSIVE book.

    I do like this book, but be honest, it is OUT OF DATE and NOT cutting edge at all.

  29. Real World Design Patterns by Waffle+Iron · · Score: 5, Funny
    Book learnin' is fine and all, but here are some design patterns from the real world:

    The Demo design pattern:
    Boss: We need to have a working demo by the trade show next month.
    Developer: OK, but it's just going to be a barely working hack. There's no time to do any proper design by the show. It's going to push back the ship date because we're going to have to rip out the kludges and redo them properly.
    Boss: Fine. Just get me that demo.

    The Ship date design pattern:
    Boss: We need to ship the product by the middle of next quarter.
    Developer: We don't have time to fix the demo hacks by then. We need more time to do a proper design. I told you that the ship date would be pushed back by the demo.
    Boss: Everybody saw it working at the show, and they wonder why they can't have it now. We have to go with whatever you've got.

    The Beeper Design pattern:
    Boss: Support has been getting a lot of calls from customers in the field. A lot of random crashes. We need to have a developer available 24x7 to help debug these problems. Here, take this beeper.
    Developer: I told you so.
    Boss: We need to get a demo of version 2.0 by the field sales seminar next month.
    Developer: Aaarrghhh!

    1. Re:Real World Design Patterns by patter · · Score: 1

      My god, you've been tapping the phones at our shop haven't you? :)

      --
      -- If at first you do succeed, try to hide your astonishment. -- Harry F. Banks
    2. Re:Real World Design Patterns by Mark+(ph'x) · · Score: 1

      Generally this is where the BDFH (Bastard Developer From Hell) sends the boss at high speed down a freight elevator, followed by several legacy disk arrays. (By legacy I mean 4 tonne) :)

      --
      those who control the past, control the future. those who control the present, control the past.
  30. For those who don't know... by eric2hill · · Score: 3, Informative

    Have a look at Best Book Buys. They've got pricing for most books both new and used. Searching for Design Patterns currently shows a book for $35 used and $45 new.

    --
    LOAD "SIG",8,1
    LOADING...
    READY.
    RUN
  31. Me, too by Gruneun · · Score: 4, Interesting

    I'll vouch for the book. It was one of the textbooks from a Programming Languages and Paradigms class that I took. The first 2/3 of the class was advanced Java topics, but it became significantly more interesting when we dove into design patterns.

    Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, a.k.a. The Gang of Four, did an excellent job. If you don't buy it, at least pick up a copy at Borders and skim it. You will be a better programmer for it.

    Here's another good breakdown of the book

  32. For Beginners? by Anonymous Coward · · Score: 0

    I've been programmin in various compiled & scripting languages for about 5 years now. I still consider myself a beginner because I have zero formal training even though programming is my career.

    Considering that I have zero formal CompSci training, is Design Patterns a good purchase for me?

    1. Re:For Beginners? by avi33 · · Score: 1

      I am a similarly trained programmer, and I read this book as a newbie, and browsed it since, and I have to say, I'm glad I got it free because it really hasn't crystallized my work in a new, meaningful direction.

      If you are designing a financial clearinghouse transaction system, or a space shuttle, or anything mission critical that interacts with a zillion parameters, then fully digesting this book might be worth the time.

      As a web programmer, I have seen that everything I do is more closely related to Extreme Programming methodologies: Identify function points, try to get it done quickly and without errors, make it easy to modify, maintain and interact with long term. (aka, hack.) I personally don't have the time, power, or energy to force the business users to sit through a thousand usage tests or spec docs. Then again, it's not my goal to program embedded missile systems or billion dollar transactional services, so I'm not going to waste my time trying to hold to DP's standards. I've seen the best work of myself and my peers tossed aside after 12-18 months, so really, I just try to get it done, and leave behind some explicit comments just in case it stays useful.

  33. The Design Patterns Smalltalk Companion by jimm · · Score: 1

    After reading the Gang of Four book, I picked up "The Design Patterns Smalltalk Companion" (the book at Amazon). It explains how to apply each design pattern in Smalltalk.

    I found it invaluable to be able to see the same patterns discussed and implemented in a languate different than those I normally use. Each language has its own strengths, weaknesses, and best uses. The Smalltalk Companion helps you think about how your favorite language works.

    --
    Transcript show: self sigs atRandom.
    1. Re:The Design Patterns Smalltalk Companion by Anonymous Coward · · Score: 1, Insightful

      That's a good point. I strongly recommend reading the smalltalk companion, particularly if you're a C++-and-nothing-else coder.

      However, I found that for multiple-dispatch OO languages like Common Lisp CLOS, both the Design Patterns book and the companion were somewhat less than useful (except for translating Java-weenie pattern-junkie-speak), since most of the patterns assume methods belong only to a single class - and some of them (In particular, THE DREADED VISITOR PATTERN) aren't really good patterns outside C++/Java, but actually represent workarounds for the limitations of single-dispatch OO.

      Now, the authors were aware of this, and include it as a footnote to the visitor pattern. But on the whole, CLOS only gets three tiny mentions in the whole book, which is a shame, since multiple-dispatch OO is both more powerful and more natural, once you've UNLEARNED the classes-contain-methods rule. (multiple dispatch OO is akin to nouns+verbs in natural language, where hitting a nail with a hammer is different to hitting a schmuck with a lawsuit is different to hitting a schmuck with a hammer)

  34. The Age Issue by fermion · · Score: 1
    I sometime feel the incesent update of computer books is just a ploy to sell more books. For language reference books, frequent updates make sense. The language grows and new features must be documented. OTOH, basic introductory texts, especially those dealing with teaching, are good for many years. Design patterns is fundamental knowledge. The examples may be old, but they effectively illustrate all points. It still fullfils it's mandate, and should be read by anyone writing code.

    I see a problem because younger people tend to ignore books because they are old. I recently talked to a (20ish) manager who spoke like he never read The Mythical Man Month or Debugging the Development Process. It was like he really believed that a 80 hour work weeks and more programmers would bring the project in on time.

    As has been viciously shown over the past couple years, fundamentals don't change just because someone rewrites a book. It is precisely those books that prove to be fundamental, those books that do not need to be updated every few years, that provide a person with a basis of knowledge.

    --
    "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
    1. Re:The Age Issue by Anonymous Coward · · Score: 0

      I recently talked to a (20ish) manager... It was like he really believed that a 80 hour work weeks and more programmers would bring the project in on time.

      A 20ish "manager" is probably "managing" 18-20ish programmers who haven't read any fundamental texts on Computer Science or programming either. The project is doomed.

  35. best way to read this... by ceswiedler · · Score: 2

    Read the book, because it's good. Lots of it will make obvious sense. Use that stuff. Some of it will seem like a stretch. "You're calling that a pattern?" Don't use that stuff.

    Programming is about basic principles applied intelligently. If it's complex, it's probably not right. You have to sift through the ideas of the week, such as template-, OO-, component-, and pattern-based programming, to find the right way to solve a particular problem.

  36. Everyone actually uses these patterns by StrawberryFrog · · Score: 2
    but I get the feeling that every major software project will come up with its own "design patterns", and they probably bear little resemblance to the ones in the book

    The design pattersn book contains 23 patterns. It is a sign of it's greatness that since then, patterns have become a hot topic, but no-one has been able to produce a list of another 23 generic patterns as widely applicable.

    In other words: You're wrong. They got most of them.

    Having said that, some of these 23 are more common than others. Particularly I have coded/seen/used these ones: Abstract factory, Factory method, Singleton, Adapter, Proxy, Iterator, Observer, Visitor.

    The most common of these are becoming ubquitous. Have you never used a single instance of a global var? that's a singleton, almost, and it's a good idea to go the whole hog and enforce uniqueness. Most langauges handle DB recordsets with an iterator or something very like it. Event multicast is the observer pattern.

    It is possible to overuse/abuse patterns. I've seen code where a 'designer' has latched onto the 'abstract factory' pattern and used it as a 'golden hammer' (See Antipatterns - another fine book mentioned in other posts here)

    --

    My Karma: ran over your Dogma
    StrawberryFrog

  37. Re:read the first chapter at the book store. by Anonymous Coward · · Score: 1, Insightful
    I don't, I want software that runs and does something real. documents don't do anything but appease managers who can't code anyway. If you need to document your stuff use header files.


    You sir, should be beaten soundly with a nice big thick document. As a sysadmin I cannot recall how many times I've run across mindless fecal matter such as yourself. Documentation is a key element in any piece of software, be it a shell script or a complex application. It gives maintainers something to look at to get up to speed and provides everyone who uses your software a reference from where they can start.

    If you want to be an elitist prick who sits in a cubicle all day and writes code. Fine. Just remember that nobody in your office actually likes you and they all talk about what a prick you are behind your back. After a few years you will wonder why people who are your junior are now managing you. Keep pondering that and eventually you might become enlightened.

    Good day.
  38. a problem with patterns... by DEBEDb · · Score: 2

    Which, I think, is actually a problem with
    the way some people think, to my great annoyance -
    is that now every problem has to be thought
    of only in terms of one of these patterns,
    and [your favorite deity or lack thereof] forbid
    you actually come up with something new...

    --

    Considered harmful.
  39. Design Patterns = Software Engineering by Vagary · · Score: 2

    Design Patterns are important because they suggest that Software Engineering might actually have some content beyond regular CompSci courses.

    My school has Bachelor's degrees in both CompSci and Software Design the primary difference being that Software Design students are required to take all the Software Engineering courses while CompSci students get to choose. There was a heated discussion at a recent Dept. meeting over whether CompSci students should be allowed to take the full-credit capstone project in Software Design; it was decided that they should only be allowed to do a half-credit project: "otherwise there'll be nothing to differentiate the Software Design degree".

    Now Software Engineers can sit around and learn various patterns for four years, which is exactly what industry wants them to be doing. After all, with a 4-year degree you should be an architect managing diploma-holding-code-monkeys rather than actually writing code yourself. Computer Scientists will have no use for such courses, pointing out that they've had their own "patterns" all along: they're called "algorithms".

    1. Re:Design Patterns = Software Engineering by HeyLaughingBoy · · Score: 1
      Design Patterns are important because they suggest that Software Engineering might actually have some content beyond regular CompSci courses.

      You hit the nail right on the head. Let me explain: my background is Electrical Engineering. The first thing that hit me when I was reading Design Patterns... was "You can describe your designs this way!!!" As an EE, I can tell another EE about a design I want to do to recover a noisy clock signal which reads the phase of the incoming clock, adjusts the phase of a reference clock slowly to synch with the incoming signal and track it, so we can use the adjusted reference as a cleaned-up version of the incoming signal. Or I can just tell her I'm going to use a Phase-Locked Loop! Three words convey a huge amount of meaning and side-issues to another engineer while trying to explain the design in terms of its component parts may take an hour.
      By looking at software at such an abstracted level, communications can proceed more efficiently, and design can move faster. This is the way things are described in other fields. The faster CS/SE learns to talk about concepts at higher levels of abstraction, the faster we can get out of the current buggy mess of crud we call modern software. When was the last time you saw a cabinet fitter making his own screws?

      Even if a language was all we got out of it, the Patterns movement would already have been worth it.
  40. next step beyond objects by peter303 · · Score: 2

    Design patterns is the distillation and categorization of the most useful kinds of objects. Should be required in any computer curriculum.

  41. Yes, it's worth it. by nichomoff · · Score: 1

    I own this book and have found it to be a valuable resource when designing a system. I've used it only for small backend applications though the concepts are even more appropriate for larger ones.

  42. I Do! -- Was: Who Actually USES These Patterns? by Jack+William+Bell · · Score: 2

    Damn right! My copy of 'Design Patterns' has sticky notes sprouting out of it all over, coffee stains and every other indication that it is something I use all the time.

    Let me point out that I have owned the book since it came out and have already been through the 'Maybe this *is* a silver bullet.' stage to arrive the 'No silver bullet, but damn useful.'

    What are design patterns good for? Well, certainly not slavish adherence to a particular way of doing things. However just about every pattern in the book (and others discovered since) is really something a good programmer knows already. But the book provides a shorthand 'language' and nomenclature for discussing object designs.

    And the use of patterns has some emergent qualities as well. Sometimes thinking about your designs in this way allows you to more easily see connections, opportunities and traps you might otherwise have missed...

    Jack William Bell

    --
    - -
    Are you an SF Fan? Are you a Tru-Fan?
  43. BS by dubbayu_d_40 · · Score: 1

    Design patterns are an attempt to sidestep experience. It's like trying to learn to drive by only reading a book. For some reason, all the good coders I meet never talk about design patterns, and all the bad ones, well... do.

  44. Re:read the first chapter at the book store. by fitten · · Score: 3, Insightful

    I wish you would have signed this so I would know to never hire you.

    Something that you are most likely too young and inexperienced to understand yet is that you do not write code for yourself to maintain. A coder typically writes code and others will maintain it (because you left for another job, got promoted, the project was handed off to a maintenance crew, you got fired for your crappy work, or whatever). THEY have to make sense of your code to fix/maintain it.

    If your code is cryptic and/or undocumented, it will cost your company/team lots of time (and time is money) and frustration to debug and/or modify it. Even if you are still in the group, someone else may need to go into the code that you wrote (notice that I did not say "your code" as it is not your code if you are working for a company or contributing to an open software project) to do something. If you routinely contribute such crap to open source projects, you will quickly be denied access to any further projects.

  45. Doing OOP? You want this book. by ChaosDiscord · · Score: 2
    If you are interested in design patterns and are looking to use them, then this should be one of the books on your shelf.

    That simply isn't a strong enough statement. If you're doing object oriented programming, you owe it to yourself to at least borrow a copy to read.

    Design Patterns is not about telling you how to program. It's about discovering that lots of random, unrelated things you've been doing for years are actually related. It's about building a common language with other programmers about things you're already doing instinctively. The book starts by explaining that the patterns weren't created, they were discovered. Once they began looking for patterns, they found them everywhere. And when you see the patterns, you'll often go "Hey, I've been doing that for years, but I never really thought about it!" The book is about stepping back a bit from your work to discover patterns you've overlooked even as you implemented them. The perspective on other similar projects and teh analysis of common uses will help you apply solutions you already know to new problems. This is a great book.

  46. Design Patterns help "losers lose less" by Brad+Lucier · · Score: 5, Informative
    Peter Norvig explains why many of the classical design patterns used in C++ or Java are trivial or not needed in dynamic languages like Common Lisp, Scheme, and Dylan, and presents new, more powerful, design patterns for dynamic languages.

    Richard Gabriel thinks design patterns are important, but he also believes that the patterns found in the Gang of Four book for C++ and Java programmers mainly help losers lose less.

    1. Re:Design Patterns help "losers lose less" by Mr.+Fred+Smoothie · · Score: 2

      That's great, but until those dynamic languages gain legitimacy to business managers, who are usually the particular losers who pick the technologies for a project -- and who use whatever "everybody else" uses (i.e. "no one ever got fired for using Java") -- then patterns are an indispensable way to work around inherent limitations in popular languages which make decoupling harder.

      --

  47. Two additions... by \/\/ · · Score: 2, Informative

    "Design Patterns" really is an excellent text that everybody doing OO design/programming should read.

    While you're at it, pick up the books that inspired the idea of "design patterns" for OO design: Christopher Alexander et.al.'s books on architecture, especially A Timeless Way of Building (introduction to the idea of patterns) and A Pattern Language: Towns, Buildings, Construction, which contains their pattern catalogue (there's a third one in the series which I haven't read yet that describes the application of some of the patterns in a real-world example). Both books are beautifully written, accessible to non-architects, and (interestingly enough) seem to be more popular with computer science people than with architects.

    Back to the CS design patterns, the reason why most of the examples draw on UI techniques probably stems from the fact that most patterns result from the author's work on the ET++ framework, which was quite popular in the early 90's (one of the first integrated software development tools for C++, SNiFF, was build with it -- very nice software before it became yet another commercialized packaged bloatware thingy.)

  48. Satisfies "News for Nerds" OR "Stuff that matters" by yerricde · · Score: 1

    I guess it's a repositioning of "Slashdot: News for Nerds" to "Slashdot: Stuff for People."

    "Slashdot: News for Nerds. Stuff that matters." I take this to mean that all articles SHOULD match either "News for Nerds" or "Stuff that matters" or both. This article apparently matches the latter.

    You may find the following pages of links interesting as well:


    We don't need Disney to find Nemo
    --
    Will I retire or break 10K?
  49. Maybe Slashdot needs a Book Review Moderation by puppetluva · · Score: 5, Interesting
    Design Patterns - arguably one of the most important books of all time in software design got an "8". I figured it would get a "10" because of its relative importance. . . so

    I went to look at other recent slashdot reviews to see what other books design patterns compares to. The results are hilarious:
    • 7.5 - The Legends Of Dune - Volume 1: The Butlerian Jihad (Design patterns barely beats it, evidently I should be torn between these two books at the bookstore)
    • 9 - Linux Prgramming by Example (A "by example book" blew away an architectual classic.)
    • 10 - Dynamic HTML The Definitive Reference (2nd edition) [Evidently this groundbreaking tome on DHTML is in another class from "Design Patterns"]
    • 8.7 - Extending and Embedding Perl (The message here is - if "Design Patterns" is on your shelf, may only be a bookend to "Extending and Embedding Perl".


    I think that we should have a way to vote reviews "fair, underrated, or overrated" (and have that change the ranking) because it is clear that books with limited applicability (some only a blip on the technology horizon) often get rated better than truly groundbreaking pieces.

  50. The "Wait Until it is a Fad" Pattern by Shamanin · · Score: 1

    Pattern Name: Wait Until it is a Fad

    Intent: A programmer finally gets a clue that there is something to design patterns

    Also Known As: Hello World Pattern

    Motivation: A programmer continually hears the phrase "Singleton Patterns are for dummies" from his collegues, thus feelling much less than a dummy ...

    --
    come on fhqwhgads
  51. CD by broody · · Score: 1

    Will anyone who has bought and used the CD version comment on it? I'd be particulary interested in usabillity and the rumored "addtional content".

    --
    ~~ What's stopping you?
    1. Re:CD by tenman · · Score: 2

      I have the CD (1 disc), and love it. I refer to GOF-DP once or twice a month, and this cd is a great reference tool. I started with the book, and have used it for reference over the past 4 years. Recently a ex-coworker of mine left his copy of the CD around. I haven't looked at my book sence that day.

    2. Re:CD by Anonymous Coward · · Score: 0

      I have the cd version. I cannot comment on what additional content there may be since i never got the dead-tree version. I find the cd version to be quite usefull, the navigation was done reasonably well, and there is a lot of cross indexing that makes it easy to find what you are looking for. I always have a copy of the cd on any system i work so that i have it handy.

    3. Re:CD by Gruneun · · Score: 2

      I'm not sure if this includes the "additional content" but it has a tar of the code from the book:

      Design Patterns Source

    4. Re:CD by broody · · Score: 1

      Thanks everyone.

      It sounds like it is well put together. More than anything else it is horrid reader approaches that scare me off ebooks.

      --
      ~~ What's stopping you?
  52. Java companion on web by johnjaydk · · Score: 1
    Hi gang,

    Apart from highly recommending the GOF book I'll like to point your attention at the online Java companion to the book.

    http://www.patterndepot.com/put/8/JavaPatterns.htm

    Actually the companion can be read without the book (for those on a budget).

    Cheers, John

    --
    TCAP-Abort
  53. Refactoring to Patterns and other Resources by Logos · · Score: 2, Informative

    An alternative to designing software using patterns is to refactor code toward patterns.

    This is considered one of the best ways to use patterns by many in the patterns community -- especially to avoid the "little boy with a pattern" syndrome described by many here.

    For more on this idea, and on patterns in general check out the Portland Patterns Repository. There is also a conference every year about patterns called PLOP

    Finally, the software patterns community owes its origins to the Architectural (think buildings not code) Patterns world. Christopher Alexander is considered the father of patterns. His books A Timeless Way of Building, and A Pattern Language are technical, dry and expensive, but considered fundamental to truly grokking patterns.

    --
    We are agents of the free
  54. resources by jetlagQ · · Score: 1
    for anyone interested in patterns here is an online pattern site directory:

    http://directory.google.com/Top/Computers/Programm ing/Methodologies/Patterns_and_Anti-Patterns/

    also check out amazon.com's used books and lists from other programmers including:

    Applied Java Patterns by Stephen A. Stelting, Olav Maassen

    Pattern Languages of Program Design (series)

    Pattern-Oriented Software Architecture (series)

    Design Patterns Java Workbook by Steven John Metsker

    Design Patterns Explained: A New Perspective on Object-Oriented Design by Alan Shalloway, James R. Trott

    Concurrent Programming in Java(TM): Design Principles and Patterns (2nd Edition) by Doug Lea

    Pattern Hatching: Design Patterns Applied (Software Patterns Series) by John Vlissides

  55. Sorry, couldn't resist... by t_hunger · · Score: 1

    ... but this book is a excellent documentation for Fresco (formerly known as Berlin).

    Sorry, coudln't resist, feel free to mod me down.

    Regards,
    Tobias

    --
    Regards, Tobias
  56. Kent Beck by Get+Behind+the+Mule · · Score: 2

    I heard recently in a talk (by Craig Larman) that it was Kent Beck of Extreme Programming fame, and not the Gang of Four, who originally came up with the idea of applying Christopher Alexander's "pattern" concept to software engineering.

    Can anyone confirm or deny that?

    Of course even if that is the case, the G4 deserve very much credit for taking the idea into so much depth. But in fact like many other people, I had believed that it was Erich Gamma of the Gang in particular who had developed the concept.

    1. Re:Kent Beck by Logos · · Score: 1

      Kent was not alone, but yes he was one of the earliest advocates of patterns -- He is also a good friend of Eric's (its not that big of a community).

      As I mentioned here A good place to learn more about these topics (including Extreme Programming) is to go to the Portland Pattern Repository Which is also, incidently the first Wiki.

      --
      We are agents of the free
  57. That's because it's true by FatHogByTheAss · · Score: 2

    High pattern density shows that the engineer anctualy sat down and thought about design. Most /. kiddies are apt to sit down and start banging code without any design though at all.

    A system showing high density will, by defenition, be better designed that one without.

    --

    --
    You sure got a purty mouth...

    1. Re:That's because it's true by iabervon · · Score: 2

      But density isn't mass. You make a design worse, not better, by adding more patterns than are needed to cover the volume of the problem.

      The ideal design will do everything that needs to be done in a principled way using a pattern (either from the book or elsewhere), and nothing that doesn't need to be done.

      Furthermore, you have to make sure that the right patterns are being used. Each pattern is good for one situation, and as bad as no design for any situation that doesn't fit. A lot of patterns may indicate that the engineer sat down with the book and went through the index putting in as many as possible (and some may be being used to deal with the poor fit of others of them).

    2. Re:That's because it's true by ashultz · · Score: 1

      I hope this is a joke.

      It does show someone thought about it. But it doesn't show that the thought was any good.

      Patterns = good. Slave to patterns = bad. Equating patterns with thought = worse.

      This is like saying the more tools you take out of the toolbox the better carpentry job you do.

    3. Re:That's because it's true by FatHogByTheAss · · Score: 2

      Proper application of any tool and abandonment of good design principals is obvious enough to where it doesn't (or shouldn't) have to be stated.

      Misuse of anything will result in crap. Over compliating a system with unecessary farkles (whether they be patterns or not) is not a problem with patterns, it's a problem of poor design philosophy.

      That being said, high pattern density in any system design will result in a better design than one with lower pattern densities.

      --

      --
      You sure got a purty mouth...

    4. Re:That's because it's true by FatHogByTheAss · · Score: 2
      It's no joke, and it's pretty common knowledge. I believe it was Beck or Fowler that coined the term "pattern density."

      Any system can be abused. Patterns make system design relatively easy to convey. When "how does that work" question comes up in review, someone with knowledge of patterns will be able to provide a better solution than someone who just puts magic black boxes on the table.

      This is like saying the more tools you take out of the toolbox the better carpentry job you do.



      No it isn't. It's saying that you can't build a complex building without blueprints. Patterns represent known best practice designs. If you apply design patterns to all of your subsystems, you will end up with a superior design.

      --

      --
      You sure got a purty mouth...

    5. Re:That's because it's true by ashultz · · Score: 1


      So the subsystems that don't fit a pattern... do you just leave those out to increase the overall density?

      Patterns are like design shorthand. Just because your design isn't written in shorthand doesn't make it bad. It may well mean you spent too much time reinventing something you could have read from the book, but that doesn't make it bad either.

  58. MVC by Iffy+Bonzoolie · · Score: 1

    I've never heard of MVP, but the book makes mention of a very classic pattern: MVC (Model-View-Controller). MVC is actually heavily used in Java web development as an architecture for developing the front tier. Generally, when you hit the site, a master Controller uses CGI parameters or the request URI or both to dispatch to a sub-Controller which handles that specific type of request. The Controller is responsible for collecting data into a Model, which is basically one or more Java objects, and putting that into a request object (or session). Model objects are generally relatively dumb data-containing objects, sometimes called JDO (Java Data Objects) or JavaBeans. JDO are more focused on getting stuff out of a persistant store. The Controller then hands that Model off to a View, which is generally a JSP (or ASP, or whatever). The idea is that, given a different parameter, the Controller could hand that same model off to a different View - say you wanted to generate a page for a wireless device, just dispatch to the wireless View.

    This pattern is more of an architectural design pattern, whereas this book focuses mainly on object model design patterns. But the MVC model is actually used heavily today. Check out Struts, which is quickly becoming a standard framework for web application development.

    MFC also has some MVC in it, but they call their Model a "Document", and their Controller an "Application." Check out MSDN.

    -If

    --
    Run a pencil-and-paper RPG campaign with your far-off friends: Gametable!
    1. Re:MVC by archeopterix · · Score: 1
      I've never heard of MVP, but the book makes mention of a very classic pattern: MVC (Model-View-Controller).
      My memory must have failed me, I thought MVP is in the book too. To put it short - MVP came into being when people realized that traditional MVC with its unidirectional event flow C -> M -> V does not suit modern GUIs very well. GUI objects tend to blend view functions with controller functions, for example the text box i'm typing this comment into displays the text to me and receives keyboard events. This leaves us with Model and View (which swallowed controller), connected with Observer pattern - View observes the Model to display changes, thus Model can remain View-unaware. This is of course The Good Thing, as it enables decoupling. Unfortunately in this 'pattern' the View must know how to change the Model, which is a Bad Thing, since the View becomes Model-specialized. To get rid of this dependency we introduce Presenter, which acts as a glue between Model and View. It's main role is to intercept control events from the View and execute appropriate methods of the Model.
      MVC is actually heavily used in Java web development as an architecture for developing the front tier.

      I agree that Java implements MVC, and other patterns too, not only in the web architecture. I don't know about Struts, but this also seems web application-related and my original rant was about the way the popular builders do plain GUIs, forcing you to encode talking to Model in the events of View (To avoid further confusion: talking about Delphi and Visual-everything from MS).
      MFC also has some MVC in it, but they call their Model a "Document", and their Controller an "Application." Check out MSDN [microsoft.com].
      As to Document-View pattern described in the link you kindly provided, it seems that it is similar to Model-View (without the Presenter). Disclaimer: I don't use MFC, so I might be totally wrong here.
  59. Limitations of GoF book by Latent+Heat · · Score: 2
    You mention Iterator, and the discussion of Iterator is representative of much of the book.

    Suppose I want to implement my own Iterator rather than relying on STL. The idea that there should be a collection object and a separate "cursor" object to point into the collection object is good. I then look at their example. The collection is a linear list which which exposes a public reference to GetItemAtIndex(i). All the cursor object does is keep a private copy of int i and does a GetNextItem() by i++ and calling GetItemAtIndex(i) on the collection.

    Ok, ok, they need a simple example to show the basic concept. But if a collection has a GetItemAtIndex(int i) method, I fail to see why I need the cursor object except as a wrapper around an int i. To me, the Iterator pattern is interesting if the collection is implemented as a linked list and if GetNextItem() actually interacts with the collection on the level of traversing the list.

    So the Iterator pattern needs to give the cursor access to some of the non-public workings of the collection, so as to not break encapsulation of the collection while making the cursor efficient in its access. A Google on Java Iterator turns up the use of inner classes on the collection to do just that. I didn't find anything C++ specific, but I imagine that the cursor could be a friend class to the collection class.

    I would like to see some more concrete examples on how to implement GoF in both C++ and in Java that solves some of the technical details of how to pull these patterns off. Yes, I know about C++ friend and Java inner classes, but I would like to see the GoF show what implementations they have in mind and to comment on usage of, say C++ friend declaration, in terms of advantages and pitfalls in terms of the degree of coupling between cursor and collection and what are good design practices in terms of trading off efficiency for encapsulation.

    GoF is good at the conceptual level but weak at the concrete level.

    1. Re:Limitations of GoF book by joto · · Score: 2
      But if a collection has a GetItemAtIndex(int i) method, I fail to see why I need the cursor object except as a wrapper around an int i.

      There are two possible answers. 1: You don't. 2: Because you have other code that uses the iterator (e.g. because of templates (STL) or inheritance (Java collection framework)).

      So the Iterator pattern needs to give the cursor access to some of the non-public workings of the collection, so as to not break encapsulation of the collection while making the cursor efficient in its access.

      Why do you not want to break the encapsulation of the collection? Ok, I guess you want to do for some reason. If so, then yes, a friend class would be ok. And so would a nested class, which according to the latest C++ standard suddenly was allowed to see all members in the parent class.

      but I would like to see the GoF show what implementations they have in mind and to comment on usage of, say C++ friend declaration

      It is too bad then that the book fails to satisfy you. Personally, I have no wish for even further C++ bias in the book.

    2. Re:Limitations of GoF book by Anonymous+Brave+Guy · · Score: 2

      In general, the illustrations of patterns in the book aren't actually that well-implemented; some would go so far as to say they are actually bad. Their code to implement Singleton in C++ is horrible!

      To berate them for this would be to miss the point, however. As you observed yourself, the really important bit about Iterator is the fact that you have a separate counter from the container itself, which abstracts the process of iteration, and produces several useful effects as a result (which the book describes). The STL-based stuff in C++ is a good illustration of how this can be used in practice. The actual mechanism you use to implement this is really pretty irrelevant to the underlying point, and it's the underlying point that the book is all about.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  60. Do you need this book? by Anonymous Coward · · Score: 0

    Design Patterns is about teaching idiots how to think.

    Here's an Alternative:
    Look through all the code you have written over the years. See what worked and what didn't. Look for the structures and approaches you used intuitively and pragmatically. Find places where you almost had a good design but it got too complicated or went off on the wrong track. Find places where a simple idea that really works is buried under a lot of complexity. See if you can find any recurring themes. Keep all of this in mind for the future.

    1. Re:Do you need this book? by Anonymous Coward · · Score: 0

      Then document them, put the documentation in one place, publish it. Call the book "Design Patterns".

      Duh.

  61. Irrelevant Comparison by chromatic · · Score: 1

    Review scores are almost completely meaningless. You're comparing a single point of information from several different reviewers on several different subjects. This further dilutes any value remaining in the number.

  62. Understanding libraries by Anonymous Coward · · Score: 0

    It is not just in designing OO code that you need some knowledge of patterns. You need to know about patterns to understand existing code.

    A number of frameworks and libraries are have been designed using the patterns in this book. Understanding patterns helps understand what the library designer was trying to achieve and how to use it effectively.

    For example the decorator pattern is essential for understanding java.io library. (Okay you can understand the java.io library and have never heard of this pattern - but you would have needed to grasp the general concept even if you don't know the standard name for it)

    Personally, I think the book does read like it was written by a committee - there are a lot better writers on programming out there. But it is invaluable in OOP world.

  63. Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 4, Interesting

    GOF (Gamma, et. al.) Patterns show a primary flaw in much of OO philosophy IMO. The equivalent "patterns" in a procedural/relational (p/r) approach will typically involve roughly 80 percent relational query(s). IOW, "formulas" instead of "patterns". Formulas are not only more compact, but don't clutter up the larger-scale structure of the code. (LISP fans say similar things about GOF patterns, I would note).

    The "noun model" is mostly via the database in p/r, and is "virtual" rather than a physical code structure. GOF patterns thus look primitive, or "pre-virtual". Database designers in looking for common threads to managing noun models, discovered "pattern formulas" in the form of query languages, especially relational query languages.

    OO structures like those found in this book tend to reinvent incremental parts of database techniques from scratch each time. The programmer has to hand weave most of the interrelations and "indexing" between classes. The result is similar to the "network databases" that fell out of favor in the 1960's. The GOF Patterns movement is mostly a rehash of technology and philosophy that died in the early 70's, as variations of Codd's relational model proved superior.

    Thus, you are not only reinventing a (halfass) database with GOF, but reinventing an out-of-style one on top of that. A double-whammy no-no in my book.

    Dare I say "Disco Patterns"?

    If one understands how to use relational databases and technology properly, their need for GOF Patterns greatly diminishes IMO. I know I will take lots of heat for this, but it is what I believe. (Some niches may vary due to special requirements or equipment limitations. But I would note that 1980-era lite-duty DB's ran in like 64K.)

    (Is it just me, or is slashdot having network difficulties today? This is the 3rd repost try.)

    1. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      the "network databases" that fell out of favor in the 1960's

      Correction: that should be "...after the 1960's..."

      Also note that they sometimes went by the name "CODYSSAL Databases" if I got the spelling almost right, or at least good enuf to google.

    2. Re:Obligatory Anti-Pattern Viewpoint by colin_zr · · Score: 1

      It's "CODASYL".

    3. Re:Obligatory Anti-Pattern Viewpoint by JeremyR · · Score: 1
      Huh?

      Your entire post is a non-sequitir. I don't see how the use of design patterns in general, or any of the GoF patterns in particular, have anything to do with "reinventing a database" as you claim. Most of it simply has nothing to do with databases at all.

      How would you implement the Strategy pattern using a database? Or the Model-View-Controller pattern?

    4. Re:Obligatory Anti-Pattern Viewpoint by TummyX · · Score: 1

      Exactly. That's what I was wondering.

    5. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      How would you implement the Strategy pattern using a database?

      http://geocities.com/tablizer/prpats.htm

      In practice a "pure" strategy pattern is not that common IMO. It is usually mixed in with other factors to affect behavior selection/dispatching. Most behavior is influenced by multiple orthogonal factors in my experience. Hanging *any* behavior off of a single noun-taxonomy is not very change-friendly and multiple-factor-friendly IMO. At least in custom biz apps. Your domain may vary.

      Or the Model-View-Controller pattern?

      Isn't MVC "out of style" in the OO world anyhow? Here is some info on table-oriented GUI approaches:

      http://geocities.com/tablizer/guitable.htm

      I admit that table-oriented GUI's have not been road-tested the way OO GUI engines have. However, that does not mean they don't work.

    6. Re:Obligatory Anti-Pattern Viewpoint by ashultz · · Score: 1

      I think this is saying "if you have good database design, you don't need patterns as much" which has some truth for database backed apps. At least, that's what I think is said here.

      But there are a lot of apps that are't based on a database. And there are a lot of database apps that are that can't take time to hit the database whenever they want to jump.

    7. Re:Obligatory Anti-Pattern Viewpoint by JeremyR · · Score: 1
      I should have been more clear--the intent of my questions was not to ask how these patterns could be applied to data in a database, but how a database could be used to provide a general implementation of these patterns. For example, if I'm using Strategy S (e.g. a comparator method) in Context C (e.g. a sorting algorithm), what does a database have to do with any of this? My point here is that not everything is a database. In fact, not everything necessarily even touches a database.

      However, since you offered it, I found that your discussion at http://geocities.com/tablizer/prpats.htm describes a few reasonable ways of implementing Strategy-like behavior using database functions (apparently). I might point out that one important aspect of the Strategy pattern is that the Context has no knowledge whatsoever of the particular Strategy being used. In your examples, the closest analogue is Approach #1, using run-time expression evaluation. If the expression to be evaluated can truly be anything, then this sounds like the Strategy pattern. The other mechanisms are "Strategy-like" and are probably even useful in some contexts, but they aren't implementations of the GoF Strategy pattern per se.

      It's interesting that you titled your original message "Obligatory Anti-Pattern Viewpoint," yet on your Web page you discuss the implementation of various patterns in the context of relational databases. What you're actually doing is describing patterns of your own. Remember, a design pattern is simply a solution for a problem in a certain context, producing certain consequences. Your Web page is a discussion of exactly this. So you are actually promoting the use of patterns in what I would say is a very constructive way. So what's the "Obligatory Anti-Pattern Viewpoint" subject all about, when your Web page seems to recognize the value of design patterns and presents some useful discussion of design patterns in database programming?

      Getting back to your message: You say that "In practice a 'pure' strategy pattern is not that common IMO." In my experience, I use it all the time, and in discussion with various others, I find that it is used a lot. In fact, any Java developer who has used the built-in sorting routines for collections of user-defined classes has used the Strategy pattern: The sorting algorithm has no knowledge whatsoever of user-defined types, but if such a class provides a strategy (in the form of a Comparator), the completely generic sorting routine can sort objects of that type. That's what the Strategy pattern is all about: The Context needs no knowledge whatsoever of the specific implementations of Strategy.

      As for MVC being "out of style": Patterns are used because they provide useful solutions for problems, not because they're "in style." In any case, (1) MVC is still used; (2) "MVC" does not mean "GUI" (although many GUIs are implemented using MVC); (3) Using a database to store a definition of a GUI form may be a useful way to construct a GUI at runtime, but it is not an implementation of the MVC pattern. It may help with construction of the view, but it (a) probably couldn't implement all the details of the View, and (b) doesn't at all address the Model and Controller. Again, this does not mean that the mechanism isn't useful; it just illustrates that the use of design patterns and the use of databases are orthogonal.

      I still don't understand your bashing of design patterns. Is it because they are generally associated with OO design (which I already know you don't care for; I won't go there)? I've already pointed out that your Web page provides a mostly constructive discussion of various patterns of procedural/relational design. So, clearly you have already observed that patterns apply equally to database programming as well. Instead of taking cheap jabs at OO design patterns, is there a reason that you don't direct that energy at further developing your discussion of procedural/relational design patterns?

    8. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      For example, if I'm using Strategy S (e.g. a comparator method) in Context C (e.g. a sorting algorithm), what does a database have to do with any of this?

      I usually let the DB do the sorting for me. If you need to tweak the sort, then use a temporary work field(s). (Ideally DB's would let you add temporary sort fields, although not all vendors provide such, saddly.) Perhaps 1 in 200 of such sort needs would fail the DB-only approach, but I am not going to overhaul my successful techniques to chase after that 0.005 occurrence.

      Further, I did not say that the DB's and relational technology handled 100% of the equiv of GOF patterns. It is like using a car to go to the market. The car will take you most of the way there fairly conveniently. However, you still must walk the last 20 yards yourself. GOF tends to make you build your own vehicle for the entire trip, then brags that it also takes you into the store. It is easier to use an off-the-shelf car and just walk the remaining 20 yards than building a funky all-road scooter from *scratch*.

      Strategy pattern is that the Context has no knowledge whatsoever of the particular Strategy being used.

      Sorry, I am not sure what you mean by "Context" here.

      It's interesting that you titled your original message....

      It is tough to fit a technically accurate title into 60 odd characters. I admit I gave insufficient thought to title design.

      What you're actually doing is describing patterns of your own.

      I am not sure "pattern" applies. The relational formulas that do the bulk of the work are not any more "patterns" than a given math formula is. There are many possible combinations. Why GOF selected and paraded a subset with special names I am not quite sure yet.

      It is as if A = B + C * D deserve recognition while A = B * C - D does not. Is it based on frequency of occurrence? If so, it does not reflect my observed frequency. Further, with DB-centric approaches, a "pattern" is simply one view of many. Any given data/node/entity can *simultaneously* participate in multiple formulas or pattern views.

      I find that it is used a lot. In fact, any Java developer who has used the built-in sorting routines for collections of....

      Again, given a choice, I use databases and not code-centric collections for such things. I avoid code-based collections for all but the most trivial of collections. Your justification of patterns has twice relied on doing in code what I normally do with databases. You are trying to sell a horse saddle to a car driver :-)

      Using a database to store a definition of a GUI form may be a useful way to construct a GUI at runtime, but it is not an implementation of the MVC pattern.

      I don't believe I said it was.

      it just illustrates that the use of design patterns and the use of databases are orthogonal.

      I disagree. Either your "noun management" is via programming code, or via the database. There is little use in duplicating it in both.

      I still don't understand your bashing of design patterns.

      The OO versions of them are over-hyped and too OO-centric in their presentation. The use of the word "pattern" is also misleading in some ways IMO.

      Thank you for your feedback and analysis.

    9. Re:Obligatory Anti-Pattern Viewpoint by akuzi · · Score: 1

      Wow you are very mixed up with your terminology (and in your thinking in general). Sure SQL as a declarative relational language is quite powerful for certain tasks, but by itself it isn't a general purpose programming language (for a start it's associated with a permanent data store, it doesn't have any I/O etc). There are also computation tasks which are very difficult to do in it (try maintaining recurse data structures such as trees). So you clump it together with 'procedural' programming and then mention something vague about about "formulas instead of patterns". > IOW, "formulas" versus "patterns". > Formulas are not only more compact, but don't > clutter up the larger-scale structure of the > code. (LISP fans say similar things about GOF > patterns, I would note). The concept of a pattern is as applicable to procedural or relational programming as it is to object oriented design (or architecture or whatever other design problems you have). It just happens that the GOF book is about OO design patterns. What do you mean by 'formulas'? Do you mean declarative statements (like SQL) versus imperative (for loops etc)? Your statement is meaingless to me. > Thus, you are not only reinventing a (halfass) > database with GOF, but reinventing an > out-of-style one on top of that. A double-whammy > no-no in my book. The OO design patterns in GOF are pretty fundamental and the problems they solve have been around forever. eg. database 'triggers' are an example of the observer pattern. Most aren't applicable to relational model by itself at all (eg. facade, factory etc)... On your website you map the OO patterns into the database equivalents, but it's ridiculous, all you are doing it mapping classes to tables, objects to rows, attributes to fields. So what? This isn't relational programming! You still need procedural code on top of it to implement the pattern, and then you are just simulating OO programming with procedures. > The GOF Patterns movement is mostly a rehash > of technology and philosophy that died in the > early 70's, as variations of Codd's relational > model proved superior And Codd's relational model was influenced by earlier research on knowledge representation in AI frames and semantic networks etc, inheritance in object orientation was also used in frames. Patterns are new because the give a name to design problems that previously had no names. Most of the OO design patterns are not applicable for relational programming but there is no reason to stop you from creating relational SQL patterns.

    10. Re:Obligatory Anti-Pattern Viewpoint by akuzi · · Score: 1

      Wow you are very mixed up with your terminology (and in your thinking in general).

      Sure SQL as a declarative relational language is quite powerful for certain tasks, but by itself it isn't a general purpose programming language (for a start it's associated with a permanent data store, it doesn't have any I/O etc). There are also computation tasks which are very difficult to do in it (try maintaining recurse data structures such as trees).

      So you clump it together with 'procedural' programming and then mention something vague about about "formulas instead of patterns".

      > IOW, "formulas" versus "patterns".
      > Formulas are not only more compact, but don't
      > clutter up the larger-scale structure of the
      > code. (LISP fans say similar things about GOF
      > patterns, I would note).

      The concept of a pattern is as applicable to procedural or relational programming as it is to object oriented design (or architecture or whatever other design problems you have). It just happens that the GOF book is about OO design patterns.

      What do you mean by 'formulas'? Do you mean declarative statements (like SQL) versus imperative (for loops etc)? Your statement is meaingless to me.

      > Thus, you are not only reinventing a (halfass)
      > database with GOF, but reinventing an
      > out-of-style one on top of that. A double-whammy
      > no-no in my book.

      The OO design patterns in GOF are pretty fundamental and the problems they solve have been around forever. eg. database 'triggers' are an example of the observer pattern. Most aren't applicable to relational model by itself at all (eg. facade, factory etc)...

      On your website you map the OO patterns into the database equivalents, but it's ridiculous, all you are doing it mapping classes to tables, objects to rows, attributes to fields. So what? This isn't relational programming! You still need procedural code on top of it to implement the pattern, and then you are just simulating OO programming with procedures.

      > The GOF Patterns movement is mostly a rehash
      > of technology and philosophy that died in the
      > early 70's, as variations of Codd's relational
      > model proved superior

      And Codd's relational model was influenced by earlier research on knowledge representation in AI frames and semantic networks etc, inheritance in object orientation was also used in frames.

      Patterns are new because the give a name to design problems that previously had no names. Most of the OO design patterns are not applicable for relational programming but there is no reason to stop you from creating relational SQL patterns.

    11. Re:Obligatory Anti-Pattern Viewpoint by JeremyR · · Score: 1
      For example, if I'm using Strategy S (e.g. a comparator method) in Context C (e.g. a sorting algorithm), what does a database have to do with any of this?
      I usually let the DB do the sorting for me.
      That's great if you're using a database, but not everything comes from a database. Forget the concrete examples; the point is that design patterns and databases are orthogonal. You can have one without the other. You can use them both together. Or not. They have nothing to do with each other per se.
      It is like using a car to go to the market. The car will take you most of the way there fairly conveniently. However, you still must walk the last 20 yards yourself. GOF tends to make you build your own vehicle for the entire trip, then brags that it also takes you into the store.
      I don't understand the analogy. Design patterns don't tell you what (or how much) you have to build; they just suggest solutions for solving certain design problems after you've decided what it is that you want to do. For example, if you have a building that you want to be able to get in and out of, but you want to be able to shut out the elements, a design pattern you might want to consider would be the Door.
      Strategy pattern is that the Context has no knowledge whatsoever of the particular Strategy being used.
      Sorry, I am not sure what you mean by "Context" here.
      And you just helped me to illustrate one of the values of design patterns: If we're both familiar with the Strategy pattern as described by Gamma et al, I can use the term Context, and you'll know what I'm talking about. Or, to put it in terms nearer and dearer to you, try describing a relational database design to me, but assume that I don't know what a table is, what a relationship is, what a row is, or what a column is, much less anything about referential integrity or things like that. Sooner or later I hope you'll understand that things like relationship tables (to map many-to-many relationships) are, in fact, design patterns.
      What you're actually doing is describing patterns of your own.
      I am not sure "pattern" applies. The relational formulas that do the bulk of the work are not any more "patterns" than a given math formula is. There are many possible combinations. Why GOF selected and paraded a subset with special names I am not quite sure yet.
      The term pattern applies precisely. You are defining the context of a problem, presenting a solution to the problem in that context, and describing the consequences of the design. That's the textbook definition for a design pattern!

      As for why the GoF chose the exact subset of known patterns that they did, I don't know. I suspect that the patterns presented in the book are those that they encountered most frequently in their research. This would be consistent with their stated goal of providing a lexicon of common design patterns.

      Again, given a choice, I use databases and not code-centric collections for such things. I avoid code-based collections for all but the most trivial of collections. Your justification of patterns has twice relied on doing in code what I normally do with databases. You are trying to sell a horse saddle to a car driver :-)
      I think that most of us, if we were fetching data from a database, would use ORDER BY to sort the data, as it wouldn't make sense not to. But as I've already pointed out, not everything is stored in a database. Furthermore, the example of sorting is just a very simple one that uses the Strategy pattern. If you cannot or will not consider the example outside the context of databases, then I don't understand why you insist on being obtuse.
      The OO versions of them are over-hyped and too OO-centric in their presentation. The use of the word "pattern" is also misleading in some ways IMO.
      Most (all?) of the pattern books assume that their audience is at least somewhat versed in the language of OO. You may not like OO, but it does provide a convenient language for the discussion of patterns. If all the pattern books had to reinvent their own language to discuss patterns before they could even introduce the language of patterns themselves, they would be that much harder to understand.

      And just how is the term pattern misleading? Merriam-Webster defines a pattern as "a form or model proposed for imitation : EXEMPLAR"--I think the term is perfectly appropriate.

    12. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      (* That's great if you're using a database, but not everything comes from a database. Forget the concrete examples; *)

      Well, if I was ordered *not* to use a database else I would not get a paycheck, then you are right: GOF patterns may be better than the alternatives. But to me that is like saying, "Skateboards are better than walking if you are not allowed to use a car."

      (* They have nothing to do with each other per se. *)

      I disagree. They tend to fight over territory. Procedural/relational techniques tends to abstract the noun modeling to the database, not programming code, which is where it is in most OO designs and GOF OO patterns.

      (* Furthermore, the example of sorting is just a very simple one that uses the Strategy pattern. If you cannot or will not consider the example outside the context of databases, then I don't understand why you insist on being obtuse. *)

      I would like to see them giving benefits above p/r in something I can relate to in actual code. Sorting, shapes, animals, device drivers, and the other common "training lore" used by OO enthusiasts do not appear to extrapolate to my domain. Whenever somebody has tried, the examples fall victim to my standard OO complaints about biz modeling and OO.

      (* Most (all?) of the pattern books assume that their audience is at least somewhat versed in the language of OO. You may not like OO, but it does provide a convenient language for the discussion of patterns. *)

      Why is that? (Or, is that one of those questions that launches a thousand arguments?)

    13. Re:Obligatory Anti-Pattern Viewpoint by JeremyR · · Score: 2, Insightful
      Well, if I was ordered *not* to use a database else I would not get a paycheck, then you are right: GOF patterns may be better than the alternatives. But to me that is like saying, "Skateboards are better than walking if you are not allowed to use a car."

      If you can't imagine any problem in computer science--particularly in the commercial application of computer science--that doesn't need to make use of a relational database, then either you are not trying, or you are experiencing acute myopia. As for the specific example of sorting, I'm sure you've seen some user interfaces that present some sort of data in tabular format. Often in such a UI, the user can click on a column heading to instantly sort the table according to the data in that column. It seems that your approach to implementing this feature would be for the client to request all the data from the database again, this time sorted by a different column. Wouldn't it be more reasonable just to re-sort the same data right in the client application?
      I disagree. They tend to fight over territory. Procedural/relational techniques tends to abstract the noun modeling to the database, not programming code, which is where it is in most OO designs and GOF OO patterns.

      Concepts don't fight over territory; people fight over territory. And I'll reiterate yet again: A design pattern is a solution to a problem. Design patterns are used a lot in OO, but they are by no means limited to OO. In fact they're not limited to software at all--design patterns originated with architecture and construction! So if patterns can be applied to building design and OO software design, is it that much of a stretch to say they can be applied to database design?
      I would like to see them giving benefits above p/r in something I can relate to in actual code. Sorting, shapes, animals, device drivers, and the other common "training lore" used by OO enthusiasts do not appear to extrapolate to my domain. Whenever somebody has tried, the examples fall victim to my standard OO complaints about biz modeling and OO.

      You want a nontrivial example? OK. Implement an instant messaging application (along the lines of AOL Instant Messenger), including both a server and two clients: a command-line and a GUI version. Clients and servers should communicate with each other using TCP/IP. Use only a relational database to implement the entire system.
      (* Most (all?) of the pattern books assume that their audience is at least somewhat versed in the language of OO. You may not like OO, but it does provide a convenient language for the discussion of patterns. *)

      Why is that? (Or, is that one of those questions that launches a thousand arguments?)

      It's convenient for the authors to speak in the language of OO because their intended audience is fluent (or at least competent) in the language of OO. If you were to write a book about advanced optimization techniques for relational database applications, I would think your intended audience would have some sort of competency with relational database concepts.
    14. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      If you can't imagine any problem in computer science--particularly in the commercial application of computer science--that doesn't need to make use of a relational database, then either you are not trying, or you are experiencing acute myopia.

      I did not say that there never was a need for such. I am only saying that from my domain/niche's perspective, it is a relatively rare need.

      I'm sure you've seen some user interfaces that present some sort of data in tabular format. Often in such a UI, the user can click on a column heading to instantly sort the table according to the data in that column. It seems that your approach to implementing this feature would be for the client to request all the data from the database again, this time sorted by a different column.

      There has to be an "image copy" of the data *somewhere*. Might as well keep it in a lite-duty table. Anyhow, custom biz application programmers generally don't write such from *scratch* anyhow. That is a "systems" or "systems tools" programmer. I cannot speak for every niche, and few can. From the perspective of a custom biz app programmer, that is not a concern. I disclaimered niche differences from the beginning.

      Concepts don't fight over territory; people fight over territory.

      So lets inter-mix Roman and Arabic numerals then. Only people will complain :-)

      So if patterns can be applied to building design and OO software design, is it that much of a stretch to say they can be applied to database design?

      We are discussing the OO-centric GOF patterns, no?

      You want a nontrivial example? OK. Implement an instant messaging application (along the lines of AOL Instant Messenger), including both a server and two clients: a command-line and a GUI version. Clients and servers should communicate with each other using TCP/IP. Use only a relational database to implement the entire system.

      Again, this is more of a "systems tool", and generally outside the niche of a "custom biz app" developer. While we are at it, I would not recommend DB's for high-speed action games either. (Perhaps role games, but not action.)

      If you were to write a book about advanced optimization techniques for relational database applications, I would think your intended audience would have some sort of competency with relational database concepts.

      Please explain this one to me: Procedural and relational techniques are (still) quite *common* (regardless of current fashion or popularity). There are probably around 100 book titles dealing with OOP patterns, but nearly ZILCH dealing with procedural or relational patterns. Why the huge discrepancy? If 50K programmers use relational and 50K programmers use OOP, then shouldn't there be roughly as many DB titles as OOP book titles for "patterns for X"?

    15. Re:Obligatory Anti-Pattern Viewpoint by Anonymous Coward · · Score: 0

      Correction: 1960's should be 1960s

      No apostrophe is necessary.

    16. Re:Obligatory Anti-Pattern Viewpoint by JeremyR · · Score: 1
      I did not say that there never was a need for [applications that don't use relational databases]. I am only saying that from my domain/niche's perspective, it is a relatively rare need.
      I don't understand how, in one sentence you can state that OO (or design patterns, or whatever it is that you're against) aren't useful to you in your niche, but then elsewhere you appear to claim that OO and design patterns can't be useful to anyone else either because you've already worked out solutions for your niche that don't make use of OO.
      There has to be an "image copy" of the data *somewhere*. Might as well keep it in a lite-duty table.
      I'm not exactly sure what you're getting at here. Are you saying that you would have such a client re-query the database just to get the same data but sorted in a different order?
      Anyhow, custom biz application programmers generally don't write such from *scratch* anyhow. That is a "systems" or "systems tools" programmer. I cannot speak for every niche, and few can. From the perspective of a custom biz app programmer, that is not a concern. I disclaimered niche differences from the beginning.
      Again, if you're now claiming that your observations are from the point of view of a very narrow (by definition) niche of software development, how can you possibly extrapolate that OO and design patterns in general are just so much "snake oil," simply because you don't find that they apply to your niche so well?
      We are discussing the OO-centric GOF patterns, no?
      I thought were were simultaneously discussing design patterns in general as well as the GoF design patterns specifically.
      Again, [a messaging application] is more of a "systems tool", and generally outside the niche of a "custom biz app" developer. While we are at it, I would not recommend DB's for high-speed action games either. (Perhaps role games, but not action.)
      A lot of the same elements of a peer-to-peer messaging application are used in highly distributed business applications as well--the example was to illustrate that a lot of business applications require nontrivial functionality that has nothing to do with databases. Your example of action games is further evidence that there are entire classes of applications out there for which database-centric programming methodologies do not apply at all. But since OO and design patterns aren't good enough for you, they must not be good enough for developers working on these other sorts of applications either?
      Please explain this one to me: Procedural and relational techniques are (still) quite *common* (regardless of current fashion or popularity). There are probably around 100 book titles dealing with OOP patterns, but nearly ZILCH dealing with procedural or relational patterns. Why the huge discrepancy? If 50K programmers use relational and 50K programmers use OOP, then shouldn't there be roughly as many DB titles as OOP book titles for "patterns for X"?
      Publishers produce books that they (1) believe will sell, and (2) can find someone to write. So if there's a dearth of such books in the market, it's either because (1) no one has convinced a publisher that such a book would sell, and/or (2) no one has bothered to write such a book. I observed a few messages ago that you already have the beginnings of a useful collection of design patterns for database programming (whether or not you choose to see them as such). I think that with more content (the page even says there's more to come), more polish, and fewer cheap shots at OO, you'd have the makings of a book that a lot of database-centric application developers would probably find valuable. If there really are no such books in existence already, I'm sure it wouldn't be difficult to get a publisher interested. They usually like to see a proposal that includes a bit of market research--something along the lines of, "Design patterns are a recently popular idea. There are a number of design pattern books on the market today that are selling well. But the application of design patterns to database-centric applications has been largely ignored. I propose to fill this current void in the marketplace with this book." Perhaps you should look into it. Seriously.
    17. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      I don't understand how, in one sentence you can state that OO [or design patterns]....aren't useful to you in your niche, but then elsewhere you appear to claim that OO and design patterns can't be useful to anyone else either because you've already worked out solutions for your niche that don't make use of OO.

      I suspect that they are over-sold for many other niches also, but have insufficient experience is those niches to say for sure. I am merely pointing out that in at least some big niches that good databasing can greatly reduce the need for GOF patterns. It is another technique/approach to keep in mind. To summarize my POV, database techniques are undersold and GOF-OO is oversold. I never said "all" nor "never".

      I'm not exactly sure what you're getting at here. Are you saying that you would have such a client re-query the database just to get the same data but sorted in a different order?

      I used to do roughly that kind of stuff in xBase (dBASE clones) all the time. Was usually fast even on a 386. Note that it was a "local" table(s), not from the server. At least not the "buffer".

      Again, if you're now claiming that your observations are from the point of view of a very narrow (by definition) niche of software development, how can you possibly extrapolate that OO and design patterns in general are just so much "snake oil," simply because you don't find that they apply to your niche so well?

      Custom biz software is probably the largest niche around, or at least near the top. Yet OO and GOF is overhyped into it. If they are overhyped in a niche that has good alternatives, then quite possibly so are *other* niches. I can also see how a DB could improve things like operating systems so that an application or front-end could query OS settings and status without funky and inconsistent API's. Databases are underutilized IMO.

      Plus, I *did* put a niche disclaimer on my web page and the original post. Thus, I am not "changing my tune" as you seem to be suggesting. I can re-quote them if you wish.

      I thought [we] were simultaneously discussing design patterns in general as well as the GoF design patterns specifically.

      IMO "pattern" is an overloaded word, so we should stick with GOF for now.

      A lot of the same elements of a peer-to-peer messaging application are used in highly distributed business applications as well

      I don't see it. Perhaps in time-critical financial applications it might be similar. If the turn-around response time between point A and point B needs to be sub-second or a fixed tolerance, then perhaps the current crop of DB's are not the way to go. However, I rarely deal with such apps. Maybe a DB still could be used for such. I have not done enough experimentation in such areas. Perhaps hybrid techniques could be used such that the DB still plays a primary role, but some kind of "instant alert of state change" message is sent (besides polling). "Instant alerts" are the only thing lacking perhaps. Perhaps DB change triggers could send such an alert. If the instant alert is "blind" to one's noun model, then it would not be a major factor in any "pattern".

      and fewer cheap shots at OO

      Ah Mommy, you always ruin my fun :-)

    18. Re:Obligatory Anti-Pattern Viewpoint by Tablizer · · Score: 1

      ). There are also computation tasks which are very difficult to do in it (try maintaining recurse data structures such as trees).

      Some relational query languages have tree-friendly operators. It is possible. The reason it is not included more often is that the demand for it is not strong in my observation.

      eg. database 'triggers' are an example of the observer pattern.

      Perhaps, but most custom application programmers don't write databases from scratch. I did not say that using a DB is the proper way for *all* niches.

      Use the right tool for the right job. Often databases are a better tool than GOF patterns, just not as "in style".

      You still need procedural code on top of it to implement the pattern, and then you are just simulating OO programming with procedures.

      Such practices have been available at least in LISP, which pre-dates OOP languages. Did OOP steal from LISP? Everybody wants credit for ideas that work, it seems. I don't want to start another history credit debate here. Contact me off-line if you want to debate such.

      SQL patterns.

      I still think the term "pattern" has problems here, but the vocab debate is in another thread.

      My main thrust is that there are good *alternatives* to GOF OO patterns for many situations.

  64. While your shopping by redfiche · · Score: 1

    Pick up a copy of Martin Fowler's Refactoring too. The reviewed text and this one transcend any particular language and get down to the fundamental concepts underlying the code. These are the real how-to books that go beyond syntax.

    --

    Brevity is the soul of wit

    -- Polonius

  65. What exactly is a "pattern"? Need good def by Tablizer · · Score: 1, Troll

    pointing out that they've had their own "patterns" all along: they're called "algorithms".

    This harks again to a question of definitions. What is the difference between:

    1. Patterns
    2. Algorithms
    3. Formulas

    Different design methodologies and languages will implement that same thing with different arrangments of these three. (FP and relational will tend to use formula-like thingies instead of class-like structures to represent the GOF patterns, for example.)

    It might help clear up some hype and flame-wars if there were agreed-upon definitions of each of these.

    1. Re:What exactly is a "pattern"? Need good def by joto · · Score: 2
      I'll bite. Here's my try:

      1. Patterns: A way of structuring a computer program to achieve various goals such as robustness, maintainability, flexibility, ease of development, or whatever the author thinks is important. A pattern may or may not be obvious to different people, but usually some degree of non-obviousness is needed for somebody to actually write it down.

      2. Algorithm: A recipe for solving a specific class of problems. It must be possible to prove that the algorithm always solves the input problem (if it is of the right class), and that it terminates in finite time. It must also be possible to write the algorithm in some imaginable computer language for some imaginable hardware.

      3. Formula: A set of mathematical symbols thrown together in a syntactically meaningful way, intended to convey some meaning to the reader of the formula. It may also be used as the basis for a computation.

    2. Re:What exactly is a "pattern"? Need good def by Tablizer · · Score: 1

      A way of structuring a computer program to achieve various goals such as robustness, maintainability, flexibility, ease of development, or whatever the author thinks is important.

      This implies that the other two cannot solve/contribute to such goals. IOW, there is too much "political" stuff in your def IMO.

      A set of mathematical symbols thrown together in a syntactically meaningful way

      What distinquishes mathematical symbols from non-mathematical symbols? Does this include functions?

      A recipe for solving a specific class of problems.

      How does this differ from "pattern"?

      It must be possible to prove that the algorithm always solves the input problem

      That is a little stringent. Shouldn't we then have a category for non-proved algorithms? Or do you consider such worthless? If so, then why are unproven patterns not "worthless"?

    3. Re:What exactly is a "pattern"? Need good def by Anonymous Coward · · Score: 0

      >>This harks again to a question of definitions. What is the difference between:

      1. Patterns
      2. Algorithms
      3. Formulas

      Isn't this just a question of granularity? A pattern is a collection of classes, each of which may (or may not) have a specific algorithm (or mulitple) associated with it, the algorithm consisting of one or more formulas?

      Or am I coming from a completely different wavelength as you?

    4. Re:What exactly is a "pattern"? Need good def by Anonymous+Brave+Guy · · Score: 2
      If so, then why are unproven patterns not "worthless"?

      Part of your definition for patterns should include the fact that they are recurring design idioms, that have been used successfully in a variety of different places. Indeed, this is the very reason they are useful. Thus, by definition, there is no such thing as an unproven pattern.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    5. Re:What exactly is a "pattern"? Need good def by Tablizer · · Score: 1

      Indeed, this is the very reason they are useful. Thus, by definition, there is no such thing as an unproven pattern.

      I think that person meant a mathematical type of proof, no so much "road tested".

      BTW, formulas and algorithms can also be "road tested" and/or found in multiple applications. Thus, GOF-style patterns have no monopoly on that.

    6. Re:What exactly is a "pattern"? Need good def by joto · · Score: 2
      This implies that the other two cannot solve/contribute to such goals.

      No it doesn't. It's you who insist on them being separate, while in reality patterns and algorithms are more like american and us citizen. Not all concepts need to be entirely different to have different names, you know... Overlapping is ok.

      IOW, there is too much "political" stuff in your def IMO.

      You think so? Well, I couldn't find any. Could you please explain me why this is "political"? Or maybe it's your brain playing tricks with you again?

      What distinquishes mathematical symbols from non-mathematical symbols? Does this include functions?

      I've got one answer: context. Whenever you read a mathematical formula, you will find it meaningless unless you already know the meaning of the squigglies and symbols.

      Consider the formula for Newtons second law: F = ma. For it to make sense, the reader must know that F is the vector sum of all external forces on a point-like object measured in Newton, a is the second derivative of the point-like objects vector position with respect to time, meausered in meters per second squared, m is the scalar mass of the point-like object measured in kilograms, concatenation of symbols mean multiplication, and = mean equality.

      How does this differ from "pattern"?

      Patterns aren't there for solving problems in the algorithmic sense (shure, they could do that, but then you would typically call it an algorithm). They are there to solve problems for the programmer/designer. And the problems is not of the type "how do I sort?", but of the kind "how do I manage to have a large class-hierarchy in sync with my fifteen tree-walkers without getting bogged down in complexity". Sure, the programmer already knows how to solve the problem, what he is looking for is a solution to the problem of also making it reusable, maintainable, flexible, simple, etc...

      That is a little stringent. Shouldn't we then have a category for non-proved algorithms? Or do you consider such worthless?

      This is the common way to define an algorithm in the literature. Deal with it. But since you asked, yes it is possible to relax the demand for a proof. Probabilistic algorithms do just that. Instead they demand a proof that the probability of the algorithm failing can be made arbitrarily small by tuning some parameter of the algorithm. There are probably other examples as well. (In particular, heuristics is not algorithms, unless they are simply used to speed up the common case...)

      The category of non-proven algorithms is called "frontier of research". You wouldn't want to be there as a normal programmer. When you publish a newly discovered algorithm in a journal, you submit a proof, or you don't get published.

      If so, then why are unproven patterns not "worthless"?

      Because, for an algorithm you can easily state and prove something to the effect of "algorithm A actually sorts the input, and it uses O(n log n) time and space in doing so".

      For a pattern it would be much harder to prove something to the effect of "pattern A makes it much easier to keep large classe hierarchies in sync with tree-walker functions, the reduced overall complexity also makes it easier to add new tree-walkers, and to extend the class-hierarchy when needed". Therefore patterns usually aren't formally proven.

      But I'm sure the pattern community (and everyone else too) would be very happy if you could come up with a formal way of proving statements to the effect of "is much easier", "makes it more maintainable", "reduces complexity", and especially "9 out of 10 programmers working on project X prefers to do it this way..."

    7. Re:What exactly is a "pattern"? Need good def by Tablizer · · Score: 1

      Not all concepts need to be entirely different to have different names, you know... Overlapping is ok.

      Yes, but such is going to make communication tough. I was hoping there were clear guidelines to help us communicate. It appears that you are suggesting that expecting clean taxonomies of such is probably fruitless. Is this accurate?

    8. Re:What exactly is a "pattern"? Need good def by joto · · Score: 2
      It appears that you are suggesting that expecting clean taxonomies of such is probably fruitless. Is this accurate?

      No, I am saying that algorithms are already clearly defined in the literature.

      Formulas can't be, since you always need a context (unless you insist on one true formal system, something the world never will...).

      And since the pattern community seems to be calling just about anything a pattern (design patterns, anti-patterns, management patterns, language-idioms, joke-patterns, etc...), we can keep that definition for anything we find it useful to call a pattern (and that may include algorithms, and other useful things).

      One of the main ideas in the pattern movement was to not define patterns too much, because that would keep you from writing down useful patterns (if they didn't fit author X's definition).

  66. Study Groups by adamy · · Score: 2

    One guy who has done a lot with this is Joshua Kerievsky. He has a good guide to study patterens on his site, and has made a start at a book which makes patterns fit into the overall development process as part of the refactoring phase. I've gone through it once, and wil be the first to admin it needs some copy editing, but the idea is sound. Anyone interested can check it out at
    http://www.industriallogic.com/xp/refactoring/

    Check out the rest of the IL site as well, as there are good resources there.

    --
    Open Source Identity Management: FreeIPA.org
  67. Decide for yourself... by johnlcallaway · · Score: 4, Insightful

    Is it worth it?? Can't say, never read it. But,as an antiquated piece of shit myself that has seen every TNBT (the next big thing) come down the road, it probably was outdated 2 minutes after it hit the news stands, replaced by TNBT.

    But, as an antiquated piece of shit who has bought dozens of other TNBT books, it might be worth it. We used to use things called algorithms, and had books written by the thousands with them. I still have a C book on my shelf at work that I reference from time to time because of code segments it has. A good book outlasts TNBT, since they basically all say the same crap. My test is to try and decide if it will make a good reference book, something that will be used every day and can make me an even better haxor than I are now (yes, I meant the poor grammer).

    My advice is to get off your lazy geek butt and get thee to a real bookstore, not one of those Internet things. That you can do for free (well, I think you still can, there might be copyright issues). Pick it up and actually read portons of it. Buy it online if you can save a few bucks, or buy it right there if it is so good you can't live without it.

    But, for geeks sake man (woman??), make up your own friggen' mind. Make a decision. Stand up for yourself. Don't follow the rest of TNBT sheep. Or go buy the damn thing because they said so, and continue to be an Windows NT programmer. (whoopss..did I say that??)

    --
    I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
  68. More pattern information by jetlagQ · · Score: 1
    this is the best pattern site directory i've found:

    http://directory.google.com/Top/Computers/Programm ing/Methodologies/Patterns_and_Anti-Patterns/

    also check out amazon.com's used books and lists from other programmers including:

    Applied Java Patterns by Stephen A. Stelting, Olav Maassen

    Pattern Languages of Program Design (series)

    Pattern-Oriented Software Architecture (series)

    Design Patterns Java Workbook by Steven John Metsker

    Design Patterns Explained: A New Perspective on Object-Oriented Design by Alan Shalloway, James R. Trott

    Concurrent Programming in Java(TM): Design Principles and Patterns (2nd Edition) by Doug Lea

    Pattern Hatching: Design Patterns Applied (Software Patterns Series) by John Vlissides

  69. Re:Satisfies "News for Nerds" OR "Stuff that matte by be-fan · · Score: 2

    Actually, the way it is written, it clearly means that "News for Nerds" is "Stuff that matters."

    --
    A deep unwavering belief is a sure sign you're missing something...
  70. Design Patterns Aren't by prizog · · Score: 3, Interesting

    Dominus gave a hilarious and insightful talk at YAPC 2002 about Design Patterns, titled, Design Patterns Aren't.

    1. Re:Design Patterns Aren't by Tablizer · · Score: 1
      While I share a skepticism about patterns, I have a problem with one of the examples at that site:


      Is this really "a recurring design problem"?
      In C++ it is, because C++ sucks (ditto Java)

      But in a better language, it's not a problem at all

      For example, Perl provides a universal solution:

      foreach $element (@collection) {...}

      [I had to alter this formatting to make it format decently in /.]
      This fails in C++ because the type system is too weak

      Solutions with higher-order functions fail too

      No anonymous functions or lexical closure

      Ditto Java


      The problem is that it depends on a specific implementation of collections, in this case associative arrays. If you later upgrade or sidegrade your collection to something besides assoc. arrays, then you have to rewrite your iteration handling.

      My personal favorite solution is to use databases to manage collections instead of code. Then you don't have to write GetNext operations/methods for each entity because they are built into the database engine or drivers. OO has a tendency to reinvent micro-databases over and over. Databases factor most of this into one spot so that you don't have to have polymorphic interface duplication per entity for things like getNext, find, filter, search, sort, insert, delete, cross-reference, save, etc.

      A lot of method verbs are made obsolete this way. OO gets so caught up in hiding implementation that it sometimes forgets to factor interfaces. Polymorphism is often a symptom of a problem, not a solution in itself. Polymorphism often means you are *repeating* the implementation effort over and over for slightly different things. This repetition can often be factored further so that you no longer have "poly" in your "morphisms". Database designers have found a common set of collection operations and needs, and built powerful, scalable mechanisms and conventions around them.
    2. Re:Design Patterns Aren't by prizog · · Score: 1

      The problem is that it depends on a specific implementation of collections, in this case associative arrays

      Actually, @ means non-associative arrays in Perl. If you want to write your own classes which work like (associative or non-associative) arrays, you can (either in C or in Perl, although Perl's easier). And foreach works with associative arrays too, if you write foreach (keys %a) {...}. In Perl 6, I believe, you won't need to say keys; each element that foreach returns for a hash will be a key-value pair.

      My personal favorite solution is to use databases to manage collections instead of code.

      Actually, that just moves the code to someone else's plate. And the interface for database iteration is rarely the same as for non-database iteration, so you still have the problem.

    3. Re:Design Patterns Aren't by Tablizer · · Score: 1

      If you want to write your own classes which work like (associative or non-associative) arrays, you can

      Isn't that pretty much programming in your own iterator interface then? I thought the goal was to get away from that.

      Actually, that just moves the code to someone else's plate.

      Exactly! A bunch of programmers at Oracle or MySQL do it once so that us app developers don't have to do it over and over with every class or entity.

      And the interface for database iteration is rarely the same as for non-database iteration, so you still have the problem.

      I don't see how this has to be the case. It may be tradition, but not necessarily logical.

  71. More Martin Fowler by e2d2 · · Score: 2

    Martin Fowler also recently released another patterns book dealing with enterprise patterns called Patterns of Enterprise Architecture.

    Another site mentioned by Martin Fowler is Enterprise Integration Patterns. This site deals with patterns found when creating distributed enterprise systems.

  72. Patterns Schmatterns by Anonymous Coward · · Score: 1, Interesting

    A very few principles can replace many 'patterns'. For instance, loosely-coupled designs are a good thing because they are easier to change, extend and modify. Loose coupling can often be achieved using indirection. Indirection can be realized using inheritance, functional abstractions hiding data, and even sometimes as simple a thing as a pointer-to-a-pointer. Each language offers different facilities for indirection.

    Giving these few basic ideas 20 different names, as does the GOF book, really doesn't add much value. If you get the basic idea (indirection is good) you can invent these and many other 'patterns' at will, and will be a much better developer than someone who has 'learned patterns'.

    Beware also that the term patterns implies much more universality than they deliver - use a different/more powerful language and you may find that many of the 'patterns' become unnecessary or irrelevant.

    The principles above (loose coupling and indirection are good) are here to stay. If you must read the book, try to focus on the similarities between the patterns.

    Most developers would be better served studying a programming language significantly different from the one they use than studying 'patterns'.

  73. Patterns conferences - pattern languages - pattern by tychoS · · Score: 2, Informative

    A lot has happened within the field of patterns since 1995.

    Each year there is seven patterns conferences held around the world. At each of them 15-50 patterns or pattern languages are workshopped and published in book form. Got to http://www.hillside.net/ and click on "conferences" to learn more of the conferences.

    The form has evolved a lot since the Gang of Four book was published. Pick up the proceedings for a recent patterns conference to see for your self.

    The largest repository of patterns are the proceedings for all these conferences. Unfortunately they can be very hard to get hold of unless you attended the conference at which the pattern you are interested in were workshopped or can borrow the proceedings from someone who attended.

    There is a set of four books published by Addison Wesley and easily obtainable, that are a collection of the best patterns from the first four years of these conferences.

    http://www.aw.com/catalog/academic/product/1,409 6, 0201607344,00.html
    http://www.aw.com/catalog/acad emic/product/1,4096, 0201895277,00.html
    http://www.aw.com/catalog/acad emic/product/1,4096, 0201310112,00.html

    In one of the posts above someone asked if the "Design Patterns" book was obsolete by now, because it is seven years old. Patterns are solutions to problems that arises again and again, and for which there is a solution that has been succesfully used in several independent cases. So patterns are in starch contrast to the API of the month phenomenon.

  74. good to know about--but it's accepting defeat by g4dget · · Score: 4, Insightful
    You should know about design patterns. They simply are a clear statement of object-oriented techniques that programmers have known about for decades. Think of it as a grammar and hanbook of style for programming languages.

    But design patterns also show fundamental flaws in the object-oriented languages: design patterns are abstractions for which object oriented languages have no support. While object oriented languages have support for data structures and encapsulation in the form of type checking and access specifiers, when it comes to design patterns, you have to put them in by hand, document them by hand, and make sure they are working correctly by hand. Design patters are to object oriented languages like nested loops and data structures are to assembly language: you can implement them, but the language isn't going to help. The problem is that object-oriented languages really build abstractions out of individual classes and that individual classes are the units of abstraction and encapsulation, while design patterns require abstraction and type checking at the level of groups of classes. Attempts at supporting design patterns explicitly in object oriented languages so far also have been unsatisfactory as far as I'm concerned.

    1. Re:good to know about--but it's accepting defeat by ashultz · · Score: 1

      This is all true except the conclusion. You're saying "walls are nice, but the problem with bricks is that they don't come pre-built into walls." Yes, patterns aren't pre-built, that's the point, you adapt them to your present object use.

      Nested loops aren't pre-built either, but you learn them and use them too, and you'd miss them if they were gone.

  75. Re:Doing OOP? You want this book. by vbweenie · · Score: 1

    Design Patterns may be one of those books that is useful to people in different ways at different stages in their career.

    I read it a couple of months ago, during a holiday in Ireland with my family (who mocked me righteously for doing so). Absorbing the book away from a computer screen is not a bad idea, since one of the ways it can be useful is as an aid to consolidating the things you've been learning about programming during the six months you just spent chained to a keyboard.

    I expect to return to it again soon, this time as a reference. A lot of the GoF patterns don't really fly in Visual Basic, which is what I use at work - Singleton for instance just degenerates into Global Variable, its evil twin. But I'm certainly seeing the merits of object composition, not least because implementation inheritance has to be done through delegation in VB6 anyway.

    The extent to which a more experienced coder will find such a tome useful probably depends on that individual's propensity for holistic thinking. If you spend all your time rooting around among the trees, the aerial view of the wood may surprise you. Others may have been in the habit of drawing patterns out of their own experience for years; even so, it can be good to see them named and catalogued, and to have a common terminology for communicating with others about them.

    --
    Experience is a hard school, but fools will learn no other.
  76. There is a lot of misunderstanding... by JeremyR · · Score: 1
    ...of what this book is about.

    First of all, as to whether a book like this could even be considered "antiquated": In construction, a door is a design pattern. A window is a design pattern. A stairway is a design pattern. (A design pattern, after all, is just a solution for a problem in a particular context, with a particular set of consequences.) Even though construction techniques have certainly changed over the centuries, many of the common design patterns used in construction haven't changed all that much, if at all. I expect the situation to be the same for software, at least until there is a fundamental shift in the way programming is done.

    Second, the authors of this book don't claim to have invented the patterns described within. They merely organized and catalogued a number of design patterns that were already in common use, formalizing their definition. The result is a lexicon of sorts, one that is useful not only as a reference, but (as many others have pointed out numerous times) because it provides the beginnings of a common vernacular in which developers may speak. I recently heard an analogy that works very well: a dovetail joint in carpentry. If, in communicating the design of a cabinet, a carpenter had to describe the mechanics of the dovetail joint to other carpenters, the communication would be inefficient to say the least. But, because of a common vernacular between carpenters, the term dovetail joint carries with it a specific context and a solution. Likewise, if I were to, for example, use the term strategy pattern in a conversation with other developers, it's obviously more efficient if they're familiar with the term than if I have to explain it. Gamma et al have already done the elaboration of most of the common design patterns.

    Finally, note that I used the phrase "common design patterns"--this book isn't meant to be an exhaustive lexicon of design patterns; I'm sure that would be quite impossible. Rather, it describes many of the common ones (as well as some that aren't so common). There is no implication that, "If it's not in here, it's not a design pattern." Clearly, many other design patterns exist, as there are many problems in many contexts out there to be solved. Already we see books that present technology-specific design patterns (Core J2EE Patterns by Alur et al is an example of a collection of design patterns that generally make sense only within the context of J2EE.) So Design Patterns is not intended to be a canonical reference either. It's just a starting point.

    So what is this book good for? First, it reasonably explains what design patterns are all about. (Obviously, other books do this as well; one that I like is Design Patterns Explained by Shalloway and Trott.) Second, and perhaps more importantly, the book provides an extensive (although not exhaustive lexicon of concepts, many of which are (or should be) universally used. I wouldn't say that every developer ought to be intimately familiar with every pattern described herein, but probably half of them should be in just about every developer's vocabulary. If it's useful to have this "dictionary" of design patterns on your bookshelf, then you'll probably find this book to be of value. If you already have access to design pattern references (on the Web, perhaps), then maybe you don't need this one as well.

  77. dry and old! rolfmao by pyrrho · · Score: 1

    A bit dry? Old? Hmmm. These are logical patterns. It's about as likely that they will become obsolete in a decade as say the conditional of predicate logic will! Hmmm, first order logic...formal "and" and "or", uh oh, it's over 2000 years old, it's starting to show it's age! We need something new!

    I know the review is positive, but I just couldn't avoid the new-is-better fallacy of that writing. To use a pattern or not, that's a question whose answer might change, but the only thing that would make Design Patterns obsolete is... well, nothing, the patterns could have errors, that's all. That doesn't mean they are the best solution to a given problem... but they are not presented as that. They are presented as logical abstractions for certain systems and they will always be logical abstraction for certain systems! They even mention that some of their patterns are not the efficient or best way to make the system under consideration (e.g. parsers), just like using logic isn't always the best way to make a compelling argument... but the logic does not thereby become obsolete!

    --

    -pyrrho

  78. Moderators - YHBT. HAND. by Anonymous Coward · · Score: 1, Informative

    Tablizer has some strong views on programming languages, which can generally be summed up as something like "databases are a programming language; all other languages are inferior to databases" [1]. For more details, feel free to try and twist your brain around his article on Table Oriented Programming.

    His intellectual hostility towards anything except his own ideas (and object oriented programming in particular) is fairly well known, and been discussed to death on /. before. In short, this is a fellow who has ver likely never really bothered to try to understand design patterns, nor any other OOP concept, beyond the point of mastering whatever jargon he needs to start arguing his pet theory that databases are a superior programming language.

    Tabilizer would do well to remember Carl Sagan's quote about genius...

    "But the fact that some geniuses were laughed at does not imply that all who are laughed at are geniuses. They laughed at Columbus, they laughed at Fulton, they laughed at the Wright Brothers. But they also laughed at Bozo the Clown."

    [1] For the record, this is my own summary of his position, not his own words.

    1. Re:Moderators - YHBT. HAND. by Tablizer · · Score: 0, Troll

      His intellectual hostility towards anything except his own ideas (and object oriented programming in particular) is fairly well known,

      Intellectual honestly? All OO fans do is appeal to authority, usually their own, almost NEVER objective code or facts. Glass houses.

      In short, this is a fellow who has ver likely never really bothered to try to understand design patterns, nor any other OOP concept,

      Odd, I feel that OO fans don't bother to understand databases and relational thinking, using it as a mere "storage mechanism" and can't see beyond that.

      For more details, feel free to try and twist your brain around his article on Table Oriented Programming

      I suggest you start here instead:

      http://geocities.com/tablizer/whypr.htm

      The page you reference admittedly needs some "refactoring". It is not my most consice work (probably why you selected it as a "representative" wipping boy).

      Carl Sagan's quote about genius...

      Carl Sagan also said that science should not be based on authority, but open observable information and analysis.

      This is something that OO fans don't like because their entire claim set depends on nothing externally observable except fan opinions.

      Yes, my opinions are controversial and perhaps against the prevailing wisdom. However, they are backed by at least as much information and evidence as OO relies on.

      If you have grand open evidence that OO is objectively better than database-centric approaches, then please present it. I love good evidence, especially when there is a drought of it. Fix your evidence instead of attacking me personally.

      A. Stepanov and Paul Graham, both very successful people, have also said unpleasent things about OO and/or OO patterns. Where is your attack of them? Why attack me? I am a no-name.

    2. Re:Moderators - YHBT. HAND. by flygeek · · Score: 1

      But Bozo the Clown _was_ a genius!

    3. Re:Moderators - YHBT. HAND. by Anonymous Coward · · Score: 0

      But Bozo the Clown _was_ a genius!

      Ironically, he probably made more money than Carl Sagan (factored for inflation).

    4. Re:Moderators - YHBT. HAND. by Anonymous Coward · · Score: 0

      Tabilizer:

      Your primary reference work is your own writing.

      Your primary authority for your position is you, yourself, and nobody else.

      You attack OO proponents for appealing to authority - never code or facts - while at the same time appealing to your *own* authority, without providing either code or facts.

      Nobody really needs to attack you, either - you do quite a good job of discrediting yourself:

      This is something that OO fans don't like because their entire claim set depends on nothing externally observable except fan opinions.

      Yes, my opinions are controversial and perhaps against the prevailing wisdom. However, they are backed by at least as much information and evidence as OO relies on.

      So - which is it? Are OO claims based on nothing observable... in which case your claim to be backed by "at least as much information" means that you have - wow! - at least nothing to back your claims? Or do OO claims actually have some merit to them - in which case, you plain out lied about OO evidence/support in order to make a point for yourself?

      Well?

      There are thousands - nay, sir, *millions* - of applications that were written using C/C++ and the procedural and OOP methodologies you claim is no better than "database-centric approaches".

      Show us one application, utility, or other piece of working code written in this language you have dreamed up. Show us your benchmarks.

      SHOW US YOU HAVE SOME CLUE ABOUT WHAT YOU'RE TALKING ABOUT, AND WE'LL LISTEN.

      Until that point, please expect to be ridiculed, becuase you fall squarely into the same category as purveyors of perpetual motion machines, cold fusion kits and miracle herbal cancer cures. Extraordinary claims require extraordinary proof, sir; and your extraordinary claims are backed up by no proof at all; and, I hazard to guess, they probably never will be backed up by any proof at all, other than your own imagination.

    5. Re:Moderators - YHBT. HAND. by Tablizer · · Score: 1

      For the record, I don't claim my techniques to be *objectively* better. I can say that I work faster and more accurate with table browsers over code browsers, for example, but other people may be different.

      Many debates on this often come down to how things fit the way a person's brain and eyes or hands work or don't work, or their different perception of the likelyhood (frequency) of certain change scenarios used to test our samples.

      These are issues in psychology and physiology, not math. I am willing to agree that paradigm preferences may be highly subjective and part ways in a friendly manner. However, you guys and the industry keeps implying that there is an objective flaw in OO's competitors.

      Yet procedural/relational techniques have NOT been proven to be inferior to OOP.

      "Equal or unknown until proven otherwise"

      I have asked several times for you to present your BEST OO EVIDENCE to the world. Your best evidence would be *orthogonal* to me and my opinions or personality. So calling me "Satan" or "ignorant" or "troll" whatever is a red herring.

      You never provide it. You appear afraid of the open scrutiny. Why else can't you provide it? Because I am not worth it? Fine. Just don't claim your opinions are objective or proven but that you are otherwise too lazy or hate me too much to finish your proof. You have not finished your homework. It ain't my fault.

      Until you have evidence you are comfortable in presenting, don't put the blame on me. If you claim OO is objectively better, then the burden of evidence is on YOU. I don't have the burden to prove it objectively worse because I never claimed such. Table-centric tecniques simply map to my head and world perceptions better. How many others share this in common, I don't know.

    6. Re:Moderators - YHBT. HAND. by Anonymous Coward · · Score: 0

      you fall squarely into the same category as purveyors of perpetual motion machines, cold fusion kits and miracle herbal cancer cures.

      object oriented programming is a perpetual motion machine---it keeps contractors perpetually in business.

    7. Re:Moderators - YHBT. HAND. by Anonymous Coward · · Score: 0
      His intellectual hostility towards anything except his own ideas (and object oriented programming in particular) is fairly well known, and been discussed to death [slashdot.org] on /. before.

      I don't see where Tablizer's request for evidence that OOP is really better was met here. It is mostly mixed anecdotes and personal jabs back and forth. Even those ranked 5 don't show anything concrete. Some people suggested there that good evidence is too hard to gather and that anecdotes must do. This is not very comforting. I would rather see Tablizer roasted with useful evidence if you are going to do any roasting. This gap *does* lend credit to his/her claim that "maybe it is all subjective".
  79. It IS used in curricula by Anonymous Coward · · Score: 0

    I'm a computer science student at the University of Waterloo who is taking courses in software engineering. The one that I'm taking right now mentions that Design Patterns is an optional textbook, but the professor (Andrew Malton, for those UW students who've heard of him) highly recommends this book. It seemed that in his opinion, it shouldn't be optional. He actually told us to get it. And he taught us using examples from the textbook. So for those of you saying it should be used as a textbook, I have good news. It is.

  80. How about a new edition with Java Code snippets.. by Anonymous Coward · · Score: 0

    Is a new edition with Java code snippets likely?

  81. Re:Important point that the review might have miss by Anonymous Coward · · Score: 0

    For instance, you might have 're-discovered' the visitor pattern yourself and used it several times

    No thanks. Once was enough for me. Visitor is a tangled mess. It sent me on a google hunt for alternative perspectives. Eye op3ner best ever. This pattern thing is bunk.

  82. Re:Totally OT, but... by Anonymous Coward · · Score: 0

    But... but... this is GOD'S book. GOD wrote it. Wouldn't GOD know that the kidneys weren't the seat of all emotion? Why would the eternal wisdom of the bible be subject to imperfection via humans? Is God not powerful enough to force his only book to be accurate?

  83. amazon links by gabec · · Score: 2
    so... anyone other than me thinking "damn, he should have put that amazon.com link in via his account for referral points" ... lol. probably make enough dough to grab a book or two for xmas :)

    (though he'd probably get a lot of flak from ppl for making use of it, even though it is a legitimate referral. :P)

  84. You're an idiot by Anonymous Coward · · Score: 0

    No argument required.

  85. Patterns point to language deficiencies? by Grey+Haired+Luser · · Score: 2, Informative

    The GOF book is great, no questions. When I
    was a C++ programmer, it was my bible.

    When I switched to Lisp, I discovered I didn't
    seem to need most patterns anymore. Seems I'm not
    the only one to have made this discovery; a well
    known lisp expert, Peter Norvig, shows us why
    half the patters in the GOF book are not required
    in more powerful languages: http://www.norvig.com/design-patterns/

    The upshot is that most patterns are required
    because of C++'s lack of powerful abstraction
    facilities.

  86. good examples--you make my point for me by g4dget · · Score: 2
    Nested loops aren't pre-built either,

    That's a good example, because it's another area where many commonly used languages fall short. Languages should support the abstraction of control structures, but most object oriented languages don't. This is indeed just as much of a deficiency in widely used OOLs as their lack of support for design patterns.

    You're saying "walls are nice, but the problem with bricks is that they don't come pre-built into walls."

    And that's probably why bricks aren't used that much anymore: in order to lower the cost of construction and improve its consistency, many walls these days are, effectively, created "pre-built".

    1. Re:good examples--you make my point for me by ashultz · · Score: 1


      Well, you've killed my metaphors, but not the argument. But you seem to be working from "OO hasn't solved all problems, therefore it is flawed" start, which is too silly to continue battering at.

      At least, until we have a methedology that does solve all problems, at which point you win. ;)

  87. I think perhaps you read him wrong by Anonymous+Brave+Guy · · Score: 2
    I wish you would have signed this so I would know to never hire you. Something that you are most likely too young and inexperienced to understand yet is that you do not write code for yourself to maintain.

    I think perhaps you (and the AC who responded to the same post) have misread this post. While it was written in a flamey style, my take is that it's written by someone who has been there and done that plenty of times.

    Look at the two big things that he (I assume) says.

    • He values working code above theoretical niceties. He would rather have something that does the job than something that's technically excellent but doesn't work.
    • He wants the code to be the documentation (via header files), not a mountain full of paperwork.

    Personally, I think there's a lot of truth in both of those. I disagree with his take on design patterns, in that I do value and use them. Then again, I've seen plenty of people who tried to work them into a design "just because". They are truly and completely missing the point of patterns. I'd rather work with someone who didn't see the point and avoided them than someone overly clever who tried to use them without a good reason.

    Further, many (most?) managers are among the worst people in this respect. If you don't produce your 1,000 pages of buzzword-laden documentation this year, you're obviously not working hard enough. (These are the same people who judge productivity by how many lines of code you write per day.) It's a sadly overlooked truth that your code really should need little paper documentation if it's done properly, and the best low-level documentation -- indeed probably the only worthwhile low-level documentation -- is the code itself. Just follow some simple basic steps:

    • use sensible names for code and data
    • use comments in the source where they actually help (make your header files document the interface, outline a complex algorithm in pseudocode, etc.)
    • keep a clear design, with the responsibilities of functions/classes/whatever well defined and unambiguous.

    At this point, your paper documentation should be limited to something like:

    • requirements documents (to discuss with clients in their own language)
    • high-level design documentation and overviews of features (to keep the big picture clear)
    • some testing docs (though even this sort of thing is often best automated).

    Everything else really is just waste paper, yet how many projects have you seen where they print out what every single function does and file it away, even though 99% of it will be redundant next week since we changed everything? I have watched projects collapse under the weight of unhelpful or downright obstructive paperwork and procedures, and seen the light. :-)

    So seriously, while this guy comes across as flamebait, just stop and ask yourself whether he's really a pimply 15-year-old L337 Hax0r, or whether he's a 20-year veteran who's seen it all before and knows that at the end of the day, working code and lightweight procedures are worth far more than any management buzzwords and formal process certifications you care to mention.

    Of course, he could still be a 15-year-old s'kiddie, too. If he is, though, I think he writes with more than a slight ring of truth.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  88. I think that sound... by Anonymous+Brave+Guy · · Score: 2

    ...is the sound of a hundred /.ers picking up the GOF book and thumbing to page 18.

    Oh, and he's right, by the way. :-)

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  89. Using patterns after implementation by Anonymous+Brave+Guy · · Score: 2
    This really frightens me, as the patterns are not discussed at the planning stage, but as an afterthought to implementation.

    I can see where you're coming from, and I certainly agree with the "blind use" problem. On the other hand, I think design patterns are useful in two ways.

    1. They provide inspiration and ideas when you're initially designing something.
    2. They provide alternative possibilities as your design evolves.

    While the latter is hardly an afterthought, it's definitely not the (initial) planning stage. As you implement a design, and discover which bits work and which don't in practice, that design evolves. I find design patterns quite useful as a way to guide that evolution: maybe something you planned one way didn't work, but it's naturally tending towards some standard idiom and you just didn't realise it yet.

    If anything, I'd say this is actually more useful than having the patterns to hand during initial planning, when you don't really know how things are going to turn out. If you look for patterns (and not just the ones listed in the GoF book!) constantly during your adjustments, you naturally tend towards cleaner, more consistent designs.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  90. Design Pattern idea source is from Architecture by CoderDevo · · Score: 1

    For a more beautiful insight into the history and need for patterns in design (whether software or buildings), read the book that started it all.

    The Timeless Way of Building by Christopher Alexander
    Oxford University Press; ISBN: 0195024028; (1979)

    Perhaps that text is more interesting to those of us who were flip-flopping between the School of Architecture and Institute of Technology back in college, but it's also good for the Renaissance Man in you.

  91. Design Patterns Are! :-) by Anonymous+Brave+Guy · · Score: 2

    I agree that it's nice when high level languages support common programming idioms. I agree that a "for each" construct, and indeed list-based data structures in general, are often tidier than the equivalent "for loop" and array-based data structures. However, while Dominus has a good point here, he's downright misleading at times.

    To use his own example, Perl's "universal" solution to iteration -- the foreach concept -- isn't. It's very elegant in the trivial case, when you want to process the entirety of a single list. However, suppose your data is in some non-list-like format, or you don't want to iterate forwards over everything. Then your data first needs converting into a suitable list. With the Iterator pattern, the logic to do this is encapsulated in its own class. With foreach, you have to provide a suitable conversion function. But the code to do it is still there. Using foreach simply replaces one idiom with another equivalent idiom.

    Other styles of programming language each have their own answer to this. In a functional language, you would typically provide high level functions to iterate over your data structures, effectively replacing the foreach statement with a set of customised statements, each with a certain type of iteration built-in. Of course, now the logic that was in the iterator class or the list-producing function has to go in the high-level function instead.

    One could certainly argue that the foreach approach (and the accompanying use of list-based data structures, to give credit where it's due) is more elegant than the use of iterators, though clearly it also has downsides (ahem, performance issues). One could definitely argue that the higher-level function approach is more powerful than either of the above. But I think it's rather unfair to imply that they somehow remove the need to provide whatever underlying logic you need for your iteration. The examples given in this presentation show a biased case, where the iterator approach offers no benefits over a simple for loop, and the foreach construct is simplicity itself, but it ain't necessarily so under other circumstances.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  92. Review: The King James by Anonymous Coward · · Score: 0

    An oldie but goodie. Contains the full original canon, with great lines like 'The LORD ith my thepherd' (Book of Pthalms, err, Psalms) and 'Blessed are they which do hunger and thirst after righteousness: for they shall be filled.' (Book of Matt) and my personal favorite, 'Behold!' (throughout).
    If you get the hardbound edition it gives a place for all your children to sign when they get baptized (or leave a baby footprint). And the full text is available online since Britain isn't under the Bono Act.

  93. OOP is for Wankers by Anonymous Coward · · Score: 0

    POOP Patterns produce programming that is pounds of putrefied pasta such that nobody wants to reuse such crap even if they could. LISP Rulz. Java and Gammaetal is for PHB lemming lemons. Some of us know better. Hate to sound arrogant, but it is the truth.

  94. Re:Patterns conferences - pattern languages - patt by Laplace · · Score: 2

    A vibrant field? Sounds stagnant to me. How many patterns could you possibly come up with?

    --
    The middle mind speaks!
  95. Troll by hswerdfe · · Score: 1

    Quote:[Sorry, I'd just thought everyone had heard about Design Patterns long ago.]

    Get of your high horse dude.

    You may have heard of design patterns
    I may have heard of design patterns.
    My Mom has never heard of a design Pattern.
    Many First and Second Year CS Students have never heard of a design pattern.

    Just cause you are smarter than god doesn't mean every one else is.

    --
    --meh--
  96. Book of marginal value, IMO by The+Panther! · · Score: 2

    After hearing about how great a book this was for months after its initial release--from both good and bad programmers--I thought it would be worth looking into. So I picked up a copy and flipped through it, mainly hitting the patterns themselves.

    What I found was there were a lot of abstract design ideas that now have names, which I suppose is a good thing. I was dissatisfied, however, with the quality of the content. A lot of the patterns were bad designs, and I didn't see any admonitions like 'you should never use this except in this very narrow case XYZ, where you don't have any control over the code to redesign it properly (3rd party libs) and it must exhibit ABC properties', but should have been. Just presenting designs with names is like loading a gun with multicolored bullets and handing it to a child.

    After discussing the book with many co-workers, I noticed the trend that the programmers who tended to be more methodical and thorough in their up-front design, disliked the book, because it gave them no new ideas to work with, and introduced a number of useless designs on equal footing with the good ones. However, the programmers that were most scatterbrained and tended to play fast and loose with OOD and data flow, loved the book because it gave them a definitive reference for what to call the messes they create, without making judgements on their codepiles.

    I'm not saying that it's a bad book, but I am saying it appeals to a crowd that needs that kind of book. Unfortunately, no book can teach Good Design. That author would be rich indeed.

    --
    Any connection between your reality and mine is purely coincidental.
  97. Simplicity averts danger by 0x457269 · · Score: 1

    The best design for a given problem is the least conceptually complex one.

    If I can satisfy the requirements of a problem with 2 patterns, that is better than using say 7 objects.

    The rationale behind this is the more items need to be implemented the longer it takes. More importantly the number of opportunities for bugs as the result of getting the interaction between two objects wrong rises quadratically.

    By contrast using the two patterns an experienced coder will have to deal with two items, the coder is already familiar with, which then need combining.

    The notion of simplicity also describes how 'throwing in a few patterns' makes a design worse. If you are so inclined, maybe, you could develop a more formal weighting model assinging difficulty factors to a simple object (1), a composite pattern (2), an association class (3).

    Of course 'the pointy haired boss' has a tradition to reward complex solutions, which may be measured in terms of the number of patterns, objects, or even lines of code.

  98. Only 8 points ? by Anonymous Coward · · Score: 0

    Sorry, but that's silly.

    This is such a important book, because it contains fundamental stuff, that doesn't change every year.

  99. Re:Important point that the review might have miss by Quaryon · · Score: 2

    For instance, you might have 're-discovered' the visitor pattern yourself and used it several times, but without the nomenclature of this book it was very hard to actually talk about that design with other developers.

    The flip side of this is that the code you wrote to access your database used to log web site vistors confuses the hell out of the same developers when they see your "Visitor" object..

    Seriously, the number of times I've chosen a class name for perfectly good reasons only to find out it conflicts with a design pattern name is frustratingly large.

    It gets to the stage where whole swathes of the English language have been removed from the programming namespace by the people who write pattern books.

    Patterns are great in their place, but we are in danger of having too many and they can't solve all the world's problems. Stop creating more patterns and using up more valuable English words before all my variables and classes become "flirble", "glarble" and "dooberry"..!!

    Q.

  100. Trolling earns +5 informative ? by Martin+S. · · Score: 3, Insightful

    the patterns found in the Gang of Four book for C++ and Java programmers mainly help losers lose less

    Pandering to 'wannabie elite hackers' is now enough to earn +5 informative? Jesus!

    If our Industry cannot develop the tools to move on from a hacking culture to a Proffessional Software Engineering culture, we may as well all give up and go and go back to living in mud huts.

    The most simple fact is that Patterns (and the GOF) are to software engineering what Whitworth was to the Industrial Revoulution, the ubiquitous standard that make it possible for a spanner manufactured in Sheffield to tighten a bolt from Africa in a Bridge in Deli.

    Try the following for a better insight into the importance of standards in creating a revolution.

    http://www.ama-cycle.org/features/whitworth.asp
    http://www.wired.com/wired/archive/10.01/standard s .html

    ---
    It's not the ignorance in postings that disappoint it's the ignorant moderation.

  101. Re:read the first chapter at the book store. by Mr.+Fred+Smoothie · · Score: 2
    A coder typically writes code and others will maintain it (because you left for another job, got promoted, the project was handed off to a maintenance crew, you got fired for your crappy work, or whatever). THEY have to make sense of your code to fix/maintain it.
    The mere fact that you used design patterns is no guarantee that your code will be comprehensible to another programmer; actually, it will likely make your code less comprehesible to anyone but someone equally versed in Design Patterns because it adds another layer of abstraction.

    Design Patterns have 2 useful qualities, IMHO:

    • it provides a shared language to talk about design at a somewhat more abstract level than individual classes from the problem/solution domains
    • most of the patterns in the GoF book are aimed at reducing coupling between/cohesion within modules
    Its the second of these that helps to make code more maintainable, because it means that changes don't have to propagate wildly throughout the system.

    However, you still need to write terse, elegant code with terse, meaningful comments for others to navigate your code, whether you use design patterns or not.

    --

  102. Missing the point of Patterns by Martin+S. · · Score: 2

    they deal with gluing objects and GUI's together which, granted, is an important task for many apps, but not for solving basic computational problems.

    Whilst about a third of the patterns are structural that leaves two thirds that are not, they are creational and behavioural patterns. The GUI examples are just that examples, they are not the only application of those patterns. Indeed that assertion alone implied your have missed the point of patterns. A pattern represents a standardised solution for a recuring problem, problems that occur again and again. A good approach is to learn and always consider the pattern in its abstract form.

    So for example, consider the composite pattern (GOF:163), the example is based on the relationship between a number of GUI controls. i.e. Point, Line, Polygone etc. However the same pattern can also be used for a B-tree, a directory, a master-detail structure, a relational database, a menu structure, a DOM, an XML document. Indeed it represents a good solution for structuring all these requirements. In its abstract form the composite pattern can be used to implement any example of nested nodes and leafs.

  103. You don't use trees much? by Anonymous+Brave+Guy · · Score: 2
    Some relational query languages have tree-friendly operators. It is possible. The reason it is not included more often is that the demand for it is not strong in my observation.

    You don't need trees much? Presumably you also don't need hash tables, or graph structures either?

    Thank you, Mr Tabilizer. You have just proved beyond all doubt my long-held belief: your views don't work for most programmers because in your world, you only need one type of data structure, a database table, while those of us in most domains need a little more than that, and the tools to manipulate them.

    That would explain an awful lot about why you see so little value in many OO concepts.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:You don't use trees much? by Tablizer · · Score: 1

      You don't need trees much? Presumably you also don't need hash tables, or graph structures either?

      "Trees" and "hashes" are simply one of many possible views of the same information. A stack is a view, not a pysical thing, for example.

      Relational is simply a technique to provide "virtual structures" that may resemble trees or hashes or stacks or whatever other name exists for collection attribute combinations.

      you only need one type of data structure, a database table, while those of us in most domains need a little more than that, and the tools to manipulate them.

      "Type" is relative. I want them all without having to overhaul my code to see each one. In the real world a given "node" may participate in something resembling a tree, a stack, a queue, and a hash all at the same time. Gee, how do we manage that?

      A. Spehgetti code?

      B. A database?

      You know my answer. It is all a matter of "instant relativism". RDB's provide that better than any known tool on earth. To get the same thing with OO requires either a huge interface for each participant class, or spehgetti classes (or both).

  104. Don't worry about Tabilizer... by Anonymous+Brave+Guy · · Score: 2
    Again, if you're now claiming that your observations are from the point of view of a very narrow (by definition) niche of software development, how can you possibly extrapolate that OO and design patterns in general are just so much "snake oil," simply because you don't find that they apply to your niche so well?

    This is exactly the problem with Tabilizer's arguments. I've worked him out now. ;-)

    His only experience is with low performance databases. He uses terms like "custom biz apps", but this is what he means. Unsurprisingly, in this particular field, tools designed specifically for the job (databases) tend to be more applicable than general purpose programming tools.

    Unfortunately, due to his lack of outside experience, he fails to appreciate the vast number of other programming fields, many of which need rather better control over things. By his own admission elsewhere in this discussion, he doesn't see much use of tree structures, which tells you a lot. After a few of us started throwing back not just anecdotes but real world examples where databases just don't cut it -- your instant messaging application being another one -- he started adding this disclaimer you've seen: now he's only referring to his "niche", and not any others, all the time, and OMMV.

    He also has an irritating habit of reducing anything he hasn't seen personally to anecdotal evidence. I actually worked on a large (1M+ LOC) project that was essentially an OO rewrite of an old procedural app, moving to a new platform. In spite of having a smaller team to develop it and having only two domain specialists available instead of the dozens when it was first written, we managed to exceed the functionality and reliability that the original had after around 100 man-years of development, by clearly and objectively defined criteria on which the continued funding of the project depended, and we did it in about 25 man-years.

    Presumably, this was entirely down to the stunning increase in in the ability of the newer development team compared to the older. The past experience also helped us more than we were hindered by having to work out most of the low level protocols and firmware idiosyncrasies from scratch because the documentation had long since been lost. None of it had anything to do with one being written in C using purely procedural techniques, and the other being written in C++ and making use of OO, though.

    Now, to me, this is as close as you're ever realistically going to get to seeing the same thing developed with and without OO to compare them. Yet, apparently, it's just another unsupported anecdote. He wants to see the code. What does he expect, for me to give him 1M+ lines of my employer's copyrighted source code? What would he do with it anyway, spend the same six months as the rest of us learning it so that he could try to pick holes in the OO model (which, clearly, worked quite well for us most of the time)?

    Now me, I'm quite prepared to accept that when you're programming database apps, a database is the way to go. I just happen to find OO useful in programming instrument control apps that interface with external hardware, embedded control software, games, high performance mathematical code, system tools, and communications software, all of which I've worked on in the past.

    OO is no panacea, but like many other developers out there, I find it helps to organise larger applications in my niches (plural). The reason Tabilizer gets so frustrated is that he's quite short-sighted, and while he may expect and demand that the rest of the world show him some sort of evidence of OO's superiority that meets impossible criteria, vast numbers of us have seen it for ourselves and made up our own minds from personal experience. He's not going to convince us we're wrong by telling us that all our anecdotes (which we happen to know are true ourselves) aren't good enough for him.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Don't worry about Tabilizer... by Tablizer · · Score: 1

      His only experience is with low performance databases.

      Yeah. Oracle is "low performance". Must be why Larry Ellison is so poor.

      He uses terms like "custom biz apps", but this is what he means. Unsurprisingly, in this particular field, tools designed specifically for the job (databases) tend to be more applicable than general purpose programming tools.

      Well, we finally agree on something: DB's kick OO's ass in custom biz apps.

      BTW, a "general purpose manufacturing machine" would be something that puts atoms together one-by-one. It might indeed be general purpose, but I would not want to be put in charge of making an 18-wheel Truck with it.

      he started adding this disclaimer you've seen: now he's only referring to his "niche", and not any others,

      That is outright WRONG. My first message mentioned that DB's may not apply to all niches.

      we managed to exceed the functionality and reliability that the original had after around 100 man-years of development, by clearly and objectively defined criteria on which the continued funding of the project depended, and we did it in about 25 man-years.

      That is ONE anecdote. There are anecdotes of OO crashing and burning also.

      Ed Yourdon's manager satisfaction survey found NO evidence that OO projects are more likely to suceed. Yet there were hints that relational DB's helped. IOW, he surveyed *multiple* anecdotes.

      100 anecdotes > 1 anecdote

      Further, the original software may have been written by complete idiots. I have no way to tell if you are comparing good OO to bad p/r. None.

      He wants to see the code. What does he expect, for me to give him 1M+ lines of my employer's copyrighted source code?

      That is not my problem. If you can't supply open evidence, then simply say so.

      of it had anything to do with one being written in C using purely procedural techniques, and the other being written in C++ and making use of OO, though.

      C sucks IMO. I have converted projects from C to other non-OO languages with about a 5-fold increase in productivity and decrease in code size. The problem with the project you replaced may just be C itself, and not the procedural/relational paradigm.

      have seen it for ourselves and made up our own minds from personal experience.

      So, I have made a judgement based on my personal experience also, and it does not point to OOP.

  105. All data structures are *not* equal! by Anonymous+Brave+Guy · · Score: 2
    "Trees" and "hashes" are simply one of many possible views of the same information.

    But they do not necessarily represent the same information. They have different structures that provide different behaviour. You require different basic operations to hold on a key or value type to use it in a binary search tree compared to a hash table, for instance. To add data to a hash table, you require a definition for a hashing function on the keys. To add data to a binary search tree, the keys must support a suitable ordering relation.

    Further, trees have wider uses beyond storing key-value pairs for fast look up as well. As naturally recursive data structures, they provide a clean and easily manipulataed representation of many things: the results of parsing text representing regular expressions or mathematical formulae come to mind.

    Just as importantly, different data structures have different performance characteristics. A balanced tree can provide O(log N) insertion, deletion and searching. A hash table typically provides amortized constant time operations, but in the worst case is O(N).

    Consider graphs, a common structure in much mathematical work. There are two major data structures used to represent a graph: adjacency matrices and adjacency lists. Each has its uses, and offers different performance trade-offs. You simply have to understand your data, and the ways you want to access it, in order to decide which data structure(s) are most appropriate to represent it.

    "Type" is relative. I want them all without having to overhaul my code to see each one. In the real world a given "node" may participate in something resembling a tree, a stack, a queue, and a hash all at the same time. Gee, how do we manage that?

    It is mathematically impossible to achieve all of the optimal performance characteristics from conflicting data structures without any of the downsides. It cannot be done. You are telling me that you want to swap between all the different approaches at will, but in doing so, you ask the provably impossible. I am telling you that the approach you have with a database is a compromise, a good one perhaps, but still a suboptimal solution for most problems, and one over which you lack the fine control to make it optimal. Sometimes, that's good enough. For many applications, of the type I write, it is so far from optimal that it is not a practical solution to the problems I need to solve.

    Oh, and the customary answer to your question about storing data in multiple places, by the way, is simply to store the data nodes in some central structure and then store some form of reference, pointer, or index to them in your various look-up structures. I'm sure you're thinking that sounds like a database, but to the rest of us, that's a rather grand title and it's really just data structures 101. We still do it in one line of code, and ours runs a hell of a lot faster than your generic database look-up algorithms do.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:All data structures are *not* equal! by Tablizer · · Score: 1

      But they do not necessarily represent the same information. They have different structures that provide different behaviour.

      "Structure" is also relative. True about the operations, but that behavior is rarely globally consistent. One task may need a stack view, another a tree view, etc. The "rules" for "stack" in one place may not apply to another. A different process may want to fiddle with the middle of the stack instead of just push/pop.

      the results of parsing text representing regular expressions or mathematical formulae come to mind.

      (warning: sarcasm ahead)

      Which is a nice custom business application, no doubt. We parse math all day. It increases sales.

      It is mathematically impossible to achieve all of the optimal performance characteristics from conflicting data structures without any of the downsides. It cannot be done.

      Well, but relational databases come as close as ANYTHING known to such general-purpose collection needs. I would note that it *is* mathemically possible to find an optimum combination of tradeoffs to maximize a total or average. Sort of like a decathlon.

      I am telling you that the approach you have with a database is a compromise, a good one perhaps, but still a suboptimal solution for most problems

      I don't think it would be suboptimal for a simultaneous multiview decathlon. I don't know if it would be at the very top, but I am pretty sure it would be quite near it.

      For many applications, of the type I write, it is so far from optimal that it is not a practical solution to the problems I need to solve.

      I don't necessarily disagree with that. I never said an RDB was good for *all* uses. Its good for when information will be used in multiple different ways by multiple people and processes and the usage requirements for the same info will likely change in the future in unanticipated ways.

      RDB's are a little weak when it comes to predictable timing (not necessarily the same as "slow") and hierarchical arrangements. Specific vendors have added hierarchy-friendly operations to their dialect though. So it is possible to improve the tree issue.

      I'm sure you're thinking that sounds like a database, but to the rest of us, that's a rather grand title and it's really just data structures 101.

      Call it whatever you want. If your approach can provide all of these:

      1. searching
      2. sorting
      3. indexing
      4. filtering
      5. cross-entity joins (look-ups)
      6. transactions (and rollbacks) and/or
      multi-user contention/semaphores
      7. ad-hoc queries
      8. cross-application communication
      9. referential integrity
      10. coordinated backups

      then you are in the running. If not, then please leave the decathlon before you embarass your country.

      We still do it in one line of code, and ours runs a hell of a lot faster than your generic database look-up algorithms do.

      One line of code? Bullsh8t! You are polling my leg (pun he he).

      Faster at a specific, narrow task perhaps, but I doubt at the simultaneous multiview decathlon.

    2. Re:All data structures are *not* equal! by Anonymous+Brave+Guy · · Score: 2

      OK, against my better judgement I am going to post a rebuttal of some of these points.

      "Structure" is also relative. True about the operations, but that behavior is rarely globally consistent.

      I'm sorry, I don't understand what you're saying here. Could you explain it again in different words?

      One task may need a stack view, another a tree view, etc. The "rules" for "stack" in one place may not apply to another. A different process may want to fiddle with the middle of the stack instead of just push/pop.

      Then you're not using a stack any more, you're using something else.

      Of course, a stack is more of an interface than a data structure per se. It's implemented using a data structure, such as an array or linked list, but that's not quite the same thing.

      the results of parsing text representing regular expressions or mathematical formulae come to mind.

      (warning: sarcasm ahead)
      Which is a nice custom business application, no doubt. We parse math all day. It increases sales.

      You better believe it, because under the hood of your treasured database front-end, that's exactly what's going on. Without this kind of technique, you would be nowhere. You choose to use a tool that writes it, and for your application domain, that's fine. Me, I might be the guy writing that tool, so you'd better hope I get the tools I need to do it properly.

      I never said an RDB was good for *all* uses. Its good for when information will be used in multiple different ways by multiple people and processes and the usage requirements for the same info will likely change in the future in unanticipated ways.

      That's not necessarily true, of course. The app I'm currently working on demonstrably meets all of your above criteria. It often handles several megabytes of interrelated data at once, it performs some reasonably serious algorithms on that data to get the answers our customers want, and our customers' requirements vary widely. And yet, we have managed to produce some very efficient data structures, which have stood the test of time from many customers and for more than a decade, without ever having any sort of problem adapting to new requirements.

      If your approach can provide all of these: [...] then you are in the running. If not, then please leave the decathlon before you embarass your country.

      You miss the point entirely. My requirements are not the same as yours. Pretty much no-one's requirements outside of your database niche are, at least not in any major niche I've ever worked in. I don't want remote backup and full transactions every time I look up whether two nodes in a graph are connected, and if so, the data associated with that connection. I just need the answer, and fast.

      One line of code? Bullsh8t! You are polling my leg (pun he he).

      You asked about having the same data available in different structures, to suit different needs. I explained that the typical approach to this is to store your master data in a single structure, and then refer to it indirectly from each of the others you will use for look-up. Setting up that indirection requires only a single line of extra code in each case. In practice, if you're doing this in an OO program, your data is probably stored in some sort of object that ensures the integrity of the different data structures, and provides a single method that is written once and thereafter always used to add new items of data, again using only a single line. This is absolutely routine.

      Faster at a specific, narrow task perhaps, but I doubt at the simultaneous multiview decathlon.

      That depends on what you mean by "narrow". As I've mentioned before, several of the applications I've worked on have had lifetimes of several years, with the basic data structures within them adapting gracefully and staying useable and maintainable throughout. That's not narrow by any useful definition. I don't need the "flexibility" of your database. I do, however, need things done today.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    3. Re:All data structures are *not* equal! by Tablizer · · Score: 1

      ["Structure" is also relative]. I'm sorry, I don't understand what you're saying here.

      Take the "structure taxonomies" that are popular with OO fans: stack, queue, set, bag, hash, dictionary, etc.

      Are these really "structures" or "protocols"? IMO they are protocols since their actual structure is an implementation detail that the protocol hides and the protocol user should not have to care about. You seemed to agree in your reply that they are protocols.

      Then you're not using a stack any more, you're using something else.

      So if something wants to process the nodes independently of nodes created via a "stack" protocol (outside of push and pop), then that *disqualifies* it from being a "stack"? I find that a bit abrupt.

      For example, the subroutine calling "structure" in an interpreter is often considered a "stack", yet the debugger can see into the middle of it, and perhaps change stuff in the middle. Does this X-ray cabability disqualify it in your mind? I think in actual usage, most programmres would say that it does NOT disqalify it.

      Different things *need* to use the *same* data in different ways. This is a fundimental rule of my niche.

      Me, I might be the guy writing that tool, so you'd better hope I get the tools I need to do it properly.

      I never wanted to change the tools of "low level" programmers. It just seems that their needs are ruining the tool choices of other domains which can take advantage of higher abstraction-based tools, such as relational modeling and protocols.

      The primary idea of databases is to take a boat-load of *common* operations done on data collections, and package them into a consistent interface so that each developer does not have to reinvient such operations from scratch. IMO, they *have* acheived that goal from a practical perspective, and their market share seems to show that many others agree.

      And yet, we have managed to produce some very efficient data structures, which have stood the test of time from many customers and for more than a decade, without ever having any sort of problem adapting to new requirements.

      I don't want to get into an anecdote battle here. Successful biz apps have also been written in assembler on occasion.

      You miss the point entirely. My requirements are not the same as yours. Pretty much no-one's requirements outside of your database niche are, at least not in any major niche I've ever worked in. I don't want remote backup and full transactions every time I....

      I am NOT proposing a one-size-fits-all solution. There are many dozens of OO pattern books and zero relational pattern books. You have the numbers on your side. You have no reason in sight to fear relational will encroch on your niche(s) and ruin it. I am arguing that the *opposite* is the case. When there are even quantities of books on each side, then maybe I will stop fussing.

    4. Re:All data structures are *not* equal! by Anonymous+Brave+Guy · · Score: 2
      Take the "structure taxonomies" that are popular with OO fans: stack, queue, set, bag, hash, dictionary, etc. Are these really "structures" or "protocols"?

      There are data structures: various types of array, linked list, tree, etc. Then there are interfaces used to abstract those data structures: stack, queue, support of iteration to various degrees, etc. Logically enough, the latter are commonly referred to as "abstract data types". All ADTs must be implemented using some sort of data structure(s) under the hood, but a stack interface could be (and often is) implemented using a variety of different data structures depending on the particular performance characteristics needed for the problem at hand.

      So if something wants to process the nodes independently of nodes created via a "stack" protocol (outside of push and pop), then that *disqualifies* it from being a "stack"? I find that a bit abrupt.

      That is irrelevant. You cannot look inside a stack using the stack interface. I defy you to cite a single authoritative source anywhere in computing literature whose definition of a stack allows this.

      For example, the subroutine calling "structure" in an interpreter is often considered a "stack", yet the debugger can see into the middle of it, and perhaps change stuff in the middle. Does this X-ray cabability disqualify it in your mind?

      It is commonly referred to as a "call stack" because function calls work like a stack. When you call a function, you add a new function to the top of the stack. When you return from a function, you remove the function currently at the top of the stack. There is nothing else you can do. Even exceptions, as used in many languages, only perform the equivalent of a series of "pop" operations.

      Obviously, a debugger can instrument what's going on in more detail if it wishes to do so, but it won't be using a stack interface to do it. What you see in the debugger window isn't being generated from the actual call stack, but from the debugger's own internal data structures.

      I never wanted to change the tools of "low level" programmers. It just seems that their needs are ruining the tool choices of other domains which can take advantage of higher abstraction-based tools, such as relational modeling and protocols.

      This is the thing I don't understand. Aside from disagreeing with your definition of "low-level" (is anything that is not a database high level in your terms?) I wonder what you mean when you write "ruining" here. If I wanted to write a database app, I would use database tools. Depending on what else it had to do, I might choose to write it in another language, or in multiple languages, but even then, I would use a database tool to do the database work.

      Is your major argument that people are now starting to try to write what are essentially database apps using only general purpose OO languages, and not database-specific tools? If so, then I am sorry that I have missed your point for so long, and I agree entirely that that particular idea is idiotic. OO is a general-purpose approach, and it makes no sense to ignore database-specific tools if databases are what you're doing. This doesn't mean you can't write parts of your program in an OO language, of course, just that it would be sensible to control a database from your program to do the database work, and not to try creating a whole specific database in OO terms to mimic the same effect.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    5. Re:All data structures are *not* equal! by Tablizer · · Score: 1

      That is irrelevant. You cannot look inside a stack using the stack interface. I defy you to cite a single authoritative source anywhere in computing literature whose definition of a stack allows this.

      If that is the case (for the sake of argument), then a "stack" is too rigid an interface for practical biz apps IMO. Like I said, different perspectives ("interfaces" if you will) of the same given datum is a paramount requirement in custom biz apps.

      When you return from a function, you remove the function currently at the top of the stack. There is nothing else you can do.

      Yes, but debuggers allow you to diddle with variables inside the stack. Each routine instantiation has its own variable space, which is part of the "stack".

      Obviously, a debugger can instrument what's going on in more detail if it wishes to do so, but it won't be using a stack interface to do it.

      I did not say otherwise.

      I wonder what you mean when you write "ruining" here.

      Over-hype of certain concepts pushing out or diminishing use of other perfectly good techniques.

      Is your major argument that people are now starting to try to write what are essentially database apps using only general purpose OO languages, and not database-specific tools?

      I am not sure what you mean by "database app". The DB engine itself, or an app that *uses* an existing database or database engine?

      OO is a general-purpose approach

      I don't agree with this. I suppose anything that is Turing Complete could be called "general purpose", but I don't agree that OO philosophy is the best fit for every problem space.

    6. Re:All data structures are *not* equal! by Anonymous+Brave+Guy · · Score: 2
      Is your major argument that people are now starting to try to write what are essentially database apps using only general purpose OO languages, and not database-specific tools?
      I am not sure what you mean by "database app". The DB engine itself, or an app that *uses* an existing database or database engine?

      I meant what you call "custom biz apps", which basically seem to be databases with some UI on top.

      I don't agree [that OO is a general-purpose approach]. I suppose anything that is Turing Complete could be called "general purpose", but I don't agree that OO philosophy is the best fit for every problem space.

      I didn't say OO philosophy was the best fit for everything. I said it's a general-purpose approach, as in, it can be used to solve problems in many domains, not one specific one. Clearly a domain-specific tool, such as a database, will normally be more helpful for solving a problem in its own specific domain than any general-purpose approach. The smart programmer identifies any domain-specific tools that will help with his task, and then typically uses those in combination with general-purpose techniques, the latter providing functionality where no more appropriate tool is available, and providing glue between everything.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    7. Re:All data structures are *not* equal! by Tablizer · · Score: 1

      I meant what you call "custom biz apps", which basically seem to be databases with some UI on top.

      I wish it were that simple. There is usually twisty capricious business rules in there also. That is usually the hard part.

      Regarding "general purpose". OO is no more general purpose than databases are. OO is not the best solution for all domains, but neither are RDB's. I suppose you could claim that DB's are not Turing Complete, but rather a complimentary tool, but I don't think the percentage of projects/domains that OO helps is significantly more than those which can make nice use of RDB's.

  106. General purposes: relational vs OO by Anonymous+Brave+Guy · · Score: 2
    Regarding "general purpose". OO is no more general purpose than databases are. [...] I don't think the percentage of projects/domains that OO helps is significantly more than those which can make nice use of RDB's.

    Now that I have to take issue with. There are, as we have demonstrated in this thread and elsewhere, numerous fields where databases simply aren't a useful programming tool. There are very few fields where OO is not applicable if you choose to use it, though there may be specialist tools that would do the job better. (What are those tools written in, though?)

    I don't really want to get into this whole argument all over again, but just consider: I could sit down, right now, with your typical OO development system, and write you a database (either an actual DBMS or a custom biz app based on a database), and I could do this without using any Oracle, MySQL, or whatever. I can therefore do anything a database can, though perhaps not as cleanly until I've built the tools to reinvent a database.

    On the other hand, I rather suspect that you couldn't sit down with your typical database package, right now, and write me an OO compiler. In fact, I rather suspect that you couldn't sit down with your typical database package, right now, and write any of the applications I've ever worked on.

    This in itself should tell you something about the relative expressive power of the two approaches, and how general-purpose they really are.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:General purposes: relational vs OO by Tablizer · · Score: 1

      On the other hand, I rather suspect that you couldn't sit down with your typical database package, right now, and write me an OO compiler.

      I have been kicking around ideas for a table-centric interpreter for an experimental language. (It would cursur-centric rather than set-centric, I would note. Some say that cursors are not "true" relational, but that is another debate.)

      In fact, I rather suspect that you couldn't sit down with your typical database package, right now, and write any of the applications I've ever worked on.

      Use of database technology is *not* Boolean. IOW, even if it is not used for the entire application, it still may help parts. It could be part of all kinds of apps, even parts of embedded apps perhaps. That does not mean it would *always* be the *best* choice, but neither is OO.

      We have 3 categories:

      1. Can't use technology X at all
      2. Can use X for some parts
      3. Can use X for most or all

      Perhaps OOP may have less in #1 (I am not sure), but I doubt there would be much difference outside of this.