Hello everyone,
I have an enum:
enum MyFormType
{
MyForm1,
MyForm2,
MyForm3,
MyForm4
};
Basically I have a Window Form with a Panel docked at the bottom. I'd like to add buttons with actions to this panel dynamically without having many if and else's all over the place... i.e.:
MyForm1 should have 3 buttons:
Print, Save, Cancel
MyForm2 should have 4 buttons:
View, New , Save, cancel
etc
I want to have an object/class to control this depending of the MyFormType. That way it can grow dynamically without having to do changes in many places.
Would you have a Decorator? a Builder which would return a collection of buttons depending of the MyFormType?
Which design pattern or technique would you say I need to apply in here to achieve this?
Thanks