This discussion is archived
9 Replies Latest reply: Mar 27, 2013 4:00 AM by gimbal2 RSS

Design Patterns in Java

user13387916 Newbie
Currently Being Moderated
Hi,

I have a question regarding Java design patterns.
Did types listed below are appropriate:


The group of structural patterns include:
- Factory
- Factory Method
- Abstract Factory
- Static Factory Method
- Singleton
- Prototype
- Builder
The group of structural patterns include:
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
The group of functional patterns belong:
- Chain of Responsibility
- Command
- Interpreter
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template
- Visitor


The division into categories is appropriate, all mentioned both?
Please kindly check

Thanks in advance for your help.
  • 1. Re: Design Patterns in Java
    EJP Guru
    Currently Being Moderated
    Your question has nothing to do with Java whatsoever. Those design patterns are all defined in the Design Patterns book. Just read it.

    It's a valuable book, but in my opinion they could have done without a lot of the verbiage like the somewhat pointless classification you're asking about, and the bizarre metalanguage they invented to describe them certainly has not caught on, except during a brief frenzy in the late 1990s when ten thousand books appeared trying to reduce the whole of computer science to design patterns, most of which has sunk without trace.
  • 2. Re: Design Patterns in Java
    user13387916 Newbie
    Currently Being Moderated
    That's one of them read "Java Design Patterns" James William Cooper. Peter Badarycz Polish translation.

    I have a question. :)
    Why do you think the classification of design patterns is meaningless?

    Thanks for the reply
  • 3. Re: Design Patterns in Java
    EJP Guru
    Currently Being Moderated
    The book I am referring to is the original: Gamma, Helm, Johnson, & Vlissides, Design Patterns, Addison Wesley 1995. Your book should cite that, and if it doesn't it is worthless.

    The classification of design patterns is meaningless because it isn't self-evidently a rigorously specified set of mutually exclusive categories, and because knowing which category a design pattern has been placed in is of no practical value, and I speak as someone who bought the original book when it came out, and also as someone who was peripherally involved in the Design Pattern wars of the late 1990s.
  • 4. Re: Design Patterns in Java
    gimbal2 Guru
    Currently Being Moderated
    EJP wrote:
    The book I am referring to is the original: Gamma, Helm, Johnson, & Vlissides, Design Patterns, Addison Wesley 1995. Your book should cite that, and if it doesn't it is worthless.
    I also bought that one somewhere in the late 90's. I still don't know why, I don't use documented patterns and yet I manage to produce solutions to any problem thrown at me in a timely fashion that my colleagues seem to be able to read and use without problems. My experience has always been that you start to adapt the problem to the pattern in stead of the other way around.
    and also as someone who was peripherally involved in the Design Pattern wars of the late 1990s.
    In what role I wonder?
  • 5. Re: Design Patterns in Java
    Kayaman Guru
    Currently Being Moderated
    gimbal2 wrote:
    In what role I wonder?
    As an instigator ;)
  • 6. Re: Design Patterns in Java
    user13387916 Newbie
    Currently Being Moderated
    You have the right, that it does not matter which category a particular pattern when creating the project, but the characteristics of each order and make them easier to select the project.

    Speech is as a person not yet fluent familiar patterns, but who wants to learn how to use them in projects.

    Thank you very much for your feedback.
  • 7. Re: Design Patterns in Java
    EJP Guru
    Currently Being Moderated

    It's a long story. In one of the secondary DP books, which I think I still have somewhere, there is a pattern called something like Type Object, described in the usual overcooked way in several pages of complete blather, along with Partipants, Forces, etc etc etc.

    I was on a couple of DP mailing lists at the time, and I pointed out on one of them that, as the first page of the pattern actually said, this was nothing more than relational 3rd normal form, already described quite adequately already by C.J. Date in a sentence or two, expanded, with no additonal meaning, into these several pages of meta language, mostly incomprehensible, and morphed into a form that had zero practical application. I headed the message 'Type Object Considered Hilarious'.

    A short but vigorous correspondence ensured, in which of course the original authors considered themselves mortally insulted, but the killer was that at the end of it I was asked to submit my objections to the mailing list in the form of a design pattern.

    At that point I belatedly realized that DP had gone the way of every other fad I have ever seen in computing, and become a separate religion of its own, with zero connection to reality, or to its original purpose, which in this case was to classify existing practice, not create a self-referential belief system.

    I declined in a message that said I didn't feel obliged to recapitulate my already stated objections in any official syntax when they were already perfectly comprehensible as is.

    I added that the solution to every problem wasn't actually to just add another design pattern, especially in refutation of preceding ones. No reply to this.

    You can probably find it all somewhere on the Net.

    Having now had my standard whinge, several times over, I will say that the original GoF DP book was valuable in two ways: it taught me a couple of tricks I didn't know, like the Visitor pattern, and it introduced standard names that we are still using, such as Factory, Facade, Decorator, etc. Have a look at CORBA for something that badly needed this kind of standard vocabulary, but was just invented a few years too early to benefit.

  • 8. Re: Design Patterns in Java
    user13387916 Newbie
    Currently Being Moderated
    that's what I would like to learn how to use them.

    New functionality to customize design pattern, not a design pattern for the project.
  • 9. Re: Design Patterns in Java
    gimbal2 Guru
    Currently Being Moderated
    EJP wrote:
    and it introduced standard names that we are still using, such as Factory, Facade, Decorator, etc.
    Ah, that is indeed correct! The book did have some use.

    Really nice story. I wasn't even aware that there was such a "war", I was just happy that the fad quickly died away.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points