Skip to Content.
Sympa Menu

gang-of-4-patterns - Re: [gang-of-4-patterns] Doubt on Composite pattern (GOF)

gang-of-4-patterns AT lists.cs.illinois.edu

Subject: Design Patterns discussion

List archive

Re: [gang-of-4-patterns] Doubt on Composite pattern (GOF)


Chronological Thread 
  • From: oleg shteynbuk <oshteynbuk AT nyc.rr.com>
  • To: rajesh AT cs.iitm.ernet.in
  • Cc: gang-of-4-patterns AT cs.uiuc.edu
  • Subject: Re: [gang-of-4-patterns] Doubt on Composite pattern (GOF)
  • Date: Sat, 15 Nov 2003 13:47:07 -0500
  • List-archive: <http://mail.cs.uiuc.edu/pipermail/gang-of-4-patterns/>
  • List-id: Design Patterns discussion <gang-of-4-patterns.cs.uiuc.edu>

Rajesh,

not sure that I fully understand your question, composite is a tree and infinite loop could happens if your tree is cyclic but this is a problem of tree and not the pattern. Composite is actually one of the most often used patterns.

Oleg



rajesh AT cs.iitm.ernet.in
wrote:

Hello,

I have a doubt on Composite pattern. Does a composite pattern have more than one composite class ? If not, why? If so, what are the applications that it contains ?
I feel that if we have two composite classes we will get into infinite loop because one composite class will make a call to all the subclasses(of component)operation and as it makes a call to other composite class (one of the subclass of component) operation method it in turn make calls to all other subclasses operation and so on. Is it correct ?
Looking forward for ur reply

rajesh







Archive powered by MHonArc 2.6.16.

Top of Page