I have been working in C # for several years, and one thing always scares me. Delegates They have no state, they are pointers to methods of objects, and the only way to go when working with threads or any other parallel programming method that .NET can offer.
My main problem is that when programming in an object-oriented style, it is a fact that delegates break the paradigm, violating the notion that if you go Object Oriented, the design phase using UML and CRC should be displayed in the language you use.
Thus, as the name asks, real objects or an anomaly of programming are delegated, what needs to be done outside of the object-oriented design.
Is it possible for an object to be an object if it has no state and can a delegate be modeled in UML?
A famous person once gave a public lecture on astronomy. He described how the earth revolves around the sun and how the sun, in turn, revolves around the center of a huge collection of stars called our galaxy. At the end of the lecture, a little old woman in the back of the room stood up and said: “What you told us is rubbish. The world is really a flat plate supported on the back of a giant tortoise.” The scientist gave an excellent smile before answering: "What is the tortoise?" “You are very smart, young man, very smart,” the old woman said. "But it's turtles all the way down! ---- Stephen HawkinsI think this applies very well to the objects and the basic types on which they sit. Can you really say that his objects are completely omitted?
source
share