Vistor design pattern continues: merge operation, separation thinking

xiaoxiao2021-03-06  85

For a research, I hope that the code is more and more simple. Of course, if I am greedy, I hope that the code can be easily changed, which is convenient for algorithm to improve or discover new issues.

So now, my inheritance of the object and abstract base class is not very enthusiastic, because it is not very convenient to change. In addition to mature, I will generally do not actively use abstract base classes.

Another conclusion, I should hate those practices that will be scattered into the codes. One is two months I have to understand the code from the beginning. On the other hand, in addition to my no one knows those messy logical judgments. But Microsoft's ONLEFTBUTTONDOWN, ON MOUSEMOVE, I have no ability to change. (MATLAB's Ginput is good!) and Visitor model provides a means of adding newly adding mergers.

Imagine if we define the data structure class1, Class2 (common husband), then want to define function 1, function 2, in order to ensure the same interface, use the virtual function method to implement two functions, respectively. --- o, thanks to Stroustrup, I finally realize the polymorphism. But I am still not cool. Is this code to help us think?

So, I want to concentrate each function. Thanks to Visitor, he let me avoid the class of the object, and he makes me easily add new operations. Amen, thanks to Andrew Fitzgibbon evaluation, the two Marr Medal winners are really not covered. Don't ask what is the relationship between Marr Medal and Programming I don't know at all. 嘿

转载请注明原文地址:https://www.9cbs.com/read-124972.html

New Post(0)