What is the observer mode, and what is the wrong statement in the observer mode

Updated on technology 2024-05-03
8 answers
  1. Anonymous users2024-02-08

    People are really getting lazier and lazier these days.

    Obviously you can do it yourself.

    You have to post to ask someone.

  2. Anonymous users2024-02-07

    Go to CSOL Observer and take a look.

  3. Anonymous users2024-02-06

    What is incorrectly stated in the observer mode is that the observer can change the state of the observed, and then the observed person informs all observers to proceed according to the state of the observed.

    Please click Enter a description.

    Observer Mode:

    Sometimes referred to as the model-view pattern, the source-listener pattern, or the slave pattern, this is a type of software design pattern. In this mode, a target object manages all observer objects that depend on it, and actively notifies when its own state changes. This is usually done by calling the methods provided by the various observers.

    This pattern is often used to implement an event handling system.

    Please click Enter a description.

  4. Anonymous users2024-02-05

    Contemporary spiritual master Krishnamurti: "The observer influences the observed." ”

    The observer is the consciousness, the true self, the Buddha, the conscience of Sun Mocong, etc.; The observed person is this body, this feeling, this thought, this thought; When the observer observes the observed, the observed is no longer acting in the same way, in the same habits, in the original mode; When the observer is separated from the observed, it affects the observed, and invisible changes are taking place.

    If a person knows the trick of conscience, no matter how many evil thoughts and delusions he has, a "feeling" here will dissolve by itself, and it is really a pill of elixir, turning iron into gold.

  5. Anonymous users2024-02-04

    The observer pattern is a pattern of object behavior. It defines a one-to-many dependency between objects, and when the state of an object changes, all objects that depend on it are notified and automatically updated. In observer mode, a topic is the publisher of the notification, it does not need to know who its observer is when it sends the notification, and any number of observers can subscribe and receive the notification.

    The observer pattern is not only widely used in the interaction between software interface elements, but also in the interaction between business objects, permission management, etc.

    The observer mode is a perfect separation between the observer and the object being observed. For example, the user interface can act as an observer, the business data is the observed, the user interface observes the changes in the business data, and when the data changes, it is displayed on the interface. One of the principles of object-oriented design is:

    Each class in the system focuses on one feature over the other. A subject does only one thing and does it well. Observer mode draws clear boundaries between modules, improving maintainability and reusability of applications.

    The observer design pattern defines a one-to-many combination of objects so that when the state of an object changes, all objects that depend on it are notified and automatically refreshed.

    How the observer pattern is implemented.

    There are many ways to implement the observer pattern, which basically must consist of two roles: the observer and the observed. In the example above, the business data is the object being observed, and the user interface is the observer.

    There is a logical relationship between the observer and the observed, and when the observed person changes, the observer will observe the change and respond accordingly. If you use this observation process between the user interface and the business data, you can ensure that there is a clear line between the interface and the data, assuming that the needs of the application change and the performance of the interface needs to be modified, and only one user interface needs to be rebuilt, and the business data does not need to change.

    Observer mode usage scenarios.

    1. When an abstract model has two sides, one aspect of the source school depends on the other. These two hail return congratulatory seals are packed in separate objects so that they can be changed and reused independently.

    2. When the change of one object needs to change other objects at the same time, it is not known how many objects need to be changed.

    3. When an object must notify other objects, and it cannot assume who the other objects are. In other words, you don't want these objects to be tightly coupled.

  6. Anonymous users2024-02-03

    The observer pattern is also known as the publish subscribe pattern. The GOF defines the observer pattern as follows: defines a one-to-many dependency between infiltrated objects, and when the state of an object changes, all objects that depend on it are notified and automatically updated.

    Let's start with an important principle of object-oriented design, the single responsibility principle. Therefore, each object of the system should focus on discrete abstractions in the problem domain. So ideally, an object does only one thing.

    This brings a number of benefits in development: it provides reusability and maintainability, and it is a good basis for refactoring.

    As a result, almost all design patterns are based on this basic design principle. I think the origin of the observer pattern should be in the GUI and the processing of business data, because most of the examples that explain the observer pattern are based on this topic. But the application of observer mode is by no means limited to this aspect.

    Let's take a look at the components of the observer pattern.

    1) Abstract Target Role: The volt target character knows its observer and can have as many observers as you want to observe the same target. It also provides an interface for registering and deleting observer objects. Target personas are often implemented by abstract classes or interfaces.

    2) Abstract observer: An updated interface for those who need to be notified when their goals change. The role of an abstract observer is primarily implemented by an abstract class or interface.

    3) ConcreteSubject: Stores the relevant state in each concreteobserver object. When its state changes, notifications are sent to its various observers.

    4) ConcreteObserver: Stores relevant states, which should be consistent with the state of the target. Implement the observer's update interface to align its own state with the target's state.

    It is also possible to maintain a reference to the concretesubject object within this role.

  7. Anonymous users2024-02-02

    The observer principle refers to the fact that when a certain property of a system or object is measured, the state of the system being measured will change as a result, so the influence of the observer must be taken into account in the measurement process.

    The observer principle was first proposed in the field of quantum mechanics in physics. In quantum mechanics, due to the principle of superposition of quantum states, there is a superposition of quanta that can be considered to be in multiple states before observation, and will not collapse into a definite state until it is observed by the observer. This circular phenomenon is known as "measurement collapse" and means that the observer's observation behavior itself interferes with the observed system.

    Thus, the observer in quantum mechanics is no longer seen as a spectator, but as an inseparable whole from the object being observed. The observer principle is a basic principle in quantum mechanics, which affects our understanding of the microscopic world and has an important impact on quantum computing, quantum communication, and other fields in practical applications.

    In addition to quantum mechanics, the observer principle has applications in other fields of science. For example, in the social sciences, when studying human behavior, it is necessary to consider that the researcher's own behavior will have an impact on the behavior of the research subject, and this effect is called the "measurement effect". In medical research, the psychological interaction between the patient and the doctor also needs to be considered, as it can have an impact on the outcome.

    In conclusion, the observer principle points out the influence of the observer on the observed object during the measurement process, so it is necessary to use appropriate cavity lead methods and techniques to control this effect in scientific research to obtain accurate results. <>

  8. Anonymous users2024-02-01

    Dear dear, participatory observer and full observer are two different research methods, and their difference lies in the role that the observer plays in the study and the degree of influence on the subject being studied. A participatory observer is when a researcher joins a group of people being studied as a participant, works or lives with them for a period of time, and collects and analyzes data through personal experiences. This method is often used in highly subjective fields of study such as culture, social behavior, and human relations.

    Participatory observers have the advantage of gaining deeper understanding and insight, but at the same time, they may also be influenced by their own background, subjective biases, and other factors, and need to reflect and improve their research literacy. A complete observer means that the researcher only observes and records the studied group as an observer, and does not directly participate in the studied group. This method is usually used in research fields with strong objective devotivity, such as natural sciences, biology, etc.

    The advantage of being a full observer is that it can ensure the objectivity and independence of the researcher, but at the same time, it may not be possible to gain deep understanding and insight due to a lack of personal contact with the group being studied. In conclusion, participatory observer and full observer are two different research methods that are applicable to different types of research fields and need to be chosen on a case-by-case basis.

Related questions
8 answers2024-05-03

Characters such as the Patriarch of the Universe are responsible for observing and recording the major events that happen in each universe, and almost do not participate in anything, so to put it bluntly, they are an all-purpose audience.

23 answers2024-05-03

This kind of contradiction has a more elegant name, fallacious! >>>More

23 answers2024-05-03

Then install win10 with the familiar installation method.

7 answers2024-05-03

The patient's breathing, pulse, blood pressure, consciousness, pupil changes and muscle tension are mainly observed >>>More

6 answers2024-05-03

As for the design pattern, simply put, it is a kind of architecture for the structure of the entire system when developing a large system, such as module division, hierarchy, etc., which is a high-level topic, which is done by software architects, and will not be understood without certain development experience.