propertyChange
PropertyChange is a notification mechanism used in software design to indicate that a named property of an object has changed. It is typically emitted by the object's mutator or setter when the new value differs from the old one. Listeners or observers register to receive these notifications, which generally include the property name, the old value, the new value, and sometimes a reference to the source object. This pattern supports decoupled communication between components, such as models and user interfaces.
In Java, the concept is formalized in the JavaBeans framework through PropertyChangeEvent, PropertyChangeListener, and the PropertyChangeSupport
In the .NET ecosystem, a closely related pattern is provided by the INotifyPropertyChanged interface and the
Other ecosystems offer similar mechanisms, such as Cocoa’s Key-Value Observing (KVO) and various signal/slot or observer
Design considerations include avoiding unnecessary notifications, thread-safety, proper listener lifecycle management to prevent leaks, and decisions