WPF Programming Methodology

前端 未结 4 1672
予麋鹿
予麋鹿 2020-11-21 13:59

In my APP I\'m using an API of a software that my tool is managing. I\'ve DAL that contain 16 classes, 3 of them are singletons. I\'ve some logic in the .cs fil

4条回答
  •  北荒
    北荒 (楼主)
    2020-11-21 14:29

    I would definitely look into DependencyInjection, using a framework like Unity.

    Your Singleton classes could be registered with a DependencyInjection container and injected into constructors of other classes (such as ViewModels). So could other DAL classes which need to be instantiated regularly and injected into classes.

    DependencyInjection is the single most important design pattern when developing large enterprise software applications and is applicable for both Client & Server code. MVVM is a nice pattern but won't address the issue of overall application complexity related to dependency coupling.

提交回复
热议问题