oo question - mixing controller logic and business logic

后端 未结 4 2198
我寻月下人不归
我寻月下人不归 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:26

    In general, you should probably have these in two different objects, but there's a qualifier on that. It may make sense, if your project is small enough and your object model is not complex enough, to have the functionality composed into one object; however, if your functionality is complex enough, it's almost certainly going to be better for you to segregate the controller and the business objects. At the very least, design the system with an eye towards separating the controller and the business objects at a later point, if you don't completely separate them now.

提交回复
热议问题