aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes To AUTHOR: Compound Patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "To AUTHOR: Compound Patterns" Watch "To AUTHOR: Compound Patterns" New topic
Author

To AUTHOR: Compound Patterns

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Hi,

What are Compound patterns? I did not find this mentioned in GoF book?

Thanks


Groovy
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Well, as far as I understand, compound patterns are made up by combinding other patterns and the patterns contained can be seen from the outside and being used for their proposed purpose. Because compound patterns contains several other patterns, they can usually be divided into several divisions right away.

But I can't think of the real implimentation of this pattern.


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Mike Farnham
Ranch Hand

Joined: Sep 25, 2001
Posts: 76
I don't know about being able to see all of the patterns from the outside, but I have seen the Command pattern combined with the Composite pattern. Basically, you say object.do() and it will do what needs to be done and tell all of its components, as well to do what needs to be done.

Also, I've combined the Singleton with a Factory method to return only one instance of many different possible DataSources. The Singleton just holds a list within itself. This is the ServiceLocator pattern from the J2EE Design Patterns book. But, the Factory is not obvious from the outside.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Mike Farnham:
I don't know about being able to see all of the patterns from the outside, but I have seen the Command pattern combined with the Composite pattern. Basically, you say object.do() and it will do what needs to be done and tell all of its components, as well to do what needs to be done.

Also, I've combined the Singleton with a Factory method to return only one instance of many different possible DataSources. The Singleton just holds a list within itself. This is the ServiceLocator pattern from the J2EE Design Patterns book. But, the Factory is not obvious from the outside.


I guess ServiceLocator pattern from the J2EE Design Patterns book works different way and if the Factory is not obvious from the outside, then it can't be corporated into compound pattern...
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
See also http://wwwipd.ira.uka.de/~tichy/patterns/compound.html for a short explanation and two examples.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Elisabeth Robson
author
Ranch Hand

Joined: May 14, 2004
Posts: 173
    
    6
The Model View Controller pattern is an example of a compound pattern - its composed of the Observer, Strategy and Composite patterns.

A true compound pattern is a combination of patterns that becomes a pattern itself - that is, it provides a general solution to a common problem. Just putting a bunch of patterns together in your code isn't a compound pattern.

Elisabeth


Co-Author of Head First JavaScript Programming
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To AUTHOR: Compound Patterns