Is there some literature on this type of programming?

前端 未结 8 712
[愿得一人]
[愿得一人] 2021-02-01 05:56

In college I took on a class on modern physics, in which we learned about special relativity. I was completely blown away by how different frames of reference could actually ob

8条回答
  •  [愿得一人]
    2021-02-01 06:43

    Interesting. Well, I think you are doing Model->Controller->View (MVC Pattern) but in this case you are only using the Controller and Model parts separately.

    The gains here are clear if you have multiple scenarios in which the objects will be used, its a typical POJO+Managers way of doing things. In this case the objects themselves are dumb and without any functionality besides their own state.

    The advantages are clear in the ways of separation of responsibility although the disadvantages are a bit more handling on the manager side of things.

    If you think about it, if the objects don't do anything with themselves you are basically cutting out one level of indirection (the base level) and everything must be indirected to use. This means more code to handle unexpected situations, null objects and such. Perhaps more glue code than needed.

    Flexible? Yes. Practical? Only you can answer.

提交回复
热议问题