Good reasons NOT to place ViewModels in separate assembly?

后端 未结 4 1156
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-20 08:35

I\'m developing a project using the MVVM pattern in WPF.

One of the key benefits to MVVM is maintaining clear separation between business logic and presentation.

<
4条回答
  •  遇见更好的自我
    2021-02-20 09:12

    We use this kind of separation in all of our products because it helps us to see if any code violates against the UI - business logic separation.

    Most times we do it the same way as you have suggested:

    • Sample.Presentation.exe (Contains all the WPF stuff, thin assembly)

    • Sample.Applications.dll (Is responsible to the application's workflow, here are all ViewModels)

    • Sample.Domain.dll (Here are the business rules)

    We don't have encountered any issues yet and I don't expect to see any problems in future.

提交回复
热议问题