Hi all,
I have a dashboard page that hosts several sections. Each section can have different modes (Ex: preview mode, edit mode etc) and one of the differences between the modes are how they are rendered.
I plan to implement these sections as user controls. I will expose a property in the UC that defines the mode. I will need need some way of having the user control behave in a different way and render layout differently.
Question:
1. From the architecture perspective, would it be more efficient if I simply have different user controls for different modes?
2. If I go with a single UC, I can have panels that I hide/show based on the mode. I can then define a base class for each UC and create subclasses (that represents different modes) that derive from this class. This would be similar to a strategy design pattern.
Is there a better design? Thoughts?
I have a dashboard page that hosts several sections. Each section can have different modes (Ex: preview mode, edit mode etc) and one of the differences between the modes are how they are rendered.
I plan to implement these sections as user controls. I will expose a property in the UC that defines the mode. I will need need some way of having the user control behave in a different way and render layout differently.
Question:
1. From the architecture perspective, would it be more efficient if I simply have different user controls for different modes?
2. If I go with a single UC, I can have panels that I hide/show based on the mode. I can then define a base class for each UC and create subclasses (that represents different modes) that derive from this class. This would be similar to a strategy design pattern.
Is there a better design? Thoughts?
Comment