Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I have a winform UI with many different controls like datagridview, combo box, text box, list box. Data displayed to these controls are from dynamically processed busines logic implementations. I am looking for a good design(may be good design patterns) create this winform project.

One thought i have is to create a helper file for this specific UI and do the business logic on the helper file and then just returned the data required for each controls to display. By this i can avoid display logic from business logic.

Just wanted to know whether any appropriate design patterns available for this scenario? Or can we have a better design other than using the helper file method as said earlier?

What I have tried:

One thought i have is to create a helper file for this specific UI and do the business logic on the helper file and then just returned the data required for each controls to display. By this i can avoid display logic from business logic.
Posted
Updated 3-Aug-18 8:46am
v2
Comments
P Conny M Westh 3-Aug-18 9:18am    
You can use a strategy with datasources in a Logic-class, and connect them to every control in the Form Gui.

Have You thought of MVVM?
code4Better 6-Aug-18 3:33am    
Thank you Conny.
I thought of MVVM. Since i am using winforms and not WPF MVVM not sure? I know I can achieve it with INotifier and bind it. I think i may have to design a logic class for each control?

1 solution

The FACADE pattern might be of interest to you:
Facade pattern - Wikipedia[^]
It is one of the patterns of the 'Gang of four':
Design Patterns - Wikipedia[^]
You already figured most of this out by mentioning a 'helper' class.

There is also a more "handson" example available on CodeProject:
Facade Design Pattern (C#)[^]
 
Share this answer
 
v2
Comments
code4Better 6-Aug-18 3:34am    
I will check this. Thank you Rick.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900