Home  /  Questions  /  Question

88   96.5
Jan 23, 2012

What is the difference between Builder Pattern And Composite Pattern

We all know that Builder Pattern is one of the creational patterns and Composite Pattern is one of the structural patterns .
My question is, can I create a menu like a Command menu or menutoolbar with two of these Patterns?
What are their critical differences?  Or, which is better to create a menu toolbar?

Best Regards.


50   50
Jan 23, 2012

You should use Composite Pattern as your menu items will be dynamic. 
Composite creates Parent - Child relations between your objects while Builder is used to create group of objects of predefined types.

So i would suggest you to use Composite to create your menu items.

Ankit Parikh
 1 comment
thanks for your response , I want to create a custom menuhandler with composite pattern which will render menu to jquery menu on asp.net, Is it possible ,or if it is possible is there be a performance problem ? --- Volkan Genç  Jan 25, 2012