Structuring the WinForms in my presentation layer
At our company we are developing an application that has a large number of winforms that are all 开发者_开发技巧created in the same UI layer, namespace and assembly. Is there a decent way / design pattern to structure this layer?
Our UI layer communicates with the business layer wich consists of mutiple namespace like business.calculation and business.logistics. Can this structure also be used in the UI layer? It just doesn't feel right to create 100+ winforms in the same winform project.
Cheers!
Yes. A good structure will help keep your sanity as the applcation grows. You'll have some challenges:
- Identifying good namespaces
- Finding depdencies between them, which results in a logical build order
- Maintaining the namespaces as developers add new forms
For example, you might consider grouping the forms into namespaces like:
business.library.ui -- common, reusable UI components might go here
business.calculation.ui -- UI related to the calculation, which depends on the library UI
business.logistics.ui -- UI related to the logistics business area, which depends on the library and calculation UI
I find it easier to structure my namespaces according to the subsystems that make up the whole application, then organise the namespaces for the UI according to use cases.
精彩评论