开发者

Structuring the WinForms in my presentation layer

开发者 https://www.devze.com 2023-01-12 12:15 出处:网络
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 pat

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:

  1. Identifying good namespaces
  2. Finding depdencies between them, which results in a logical build order
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消