oo question - mixing controller logic and business logic

后端 未结 4 2188
我寻月下人不归
我寻月下人不归 2021-01-05 15:40

I\'m not sure if I\'m using \"standard\" terms, but this is a basic OO question I\'m trying to resolve.

I\'m coding a windows form. I don\'t want logic in the form

4条回答
  •  轮回少年
    2021-01-05 16:25

    What you're doing is a form of "fat controller" architecture. These days software development is trending toward thin controllers.

    OO design is all about decoupling. If you internalize only one thing about OO programming, let it be that.

    Check out "Domain-Driven Design Quickly." This free e-book is a condensed introduction to the concepts covered in Eric Evans' important book "Domain-Driven Design."

    Getting educated in these concepts should help you to understand how to separate business logic from the controller, or service layer.

提交回复
热议问题