Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Observer pattern
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Software design pattern based on an event-updated object with a list of dependents}} In [[software design]] and [[Software engineering|engineering]], the '''observer pattern''' is a [[software design pattern]] in which an [[Object (computer science)#Objects in object-oriented programming|object]], named the '''''subject''''', maintains a list of its dependents, called '''''observers''''', and notifies them automatically of any [[Event (computing)|state changes]], usually by calling one of their [[Method (computer science)|methods]]. It is often used for implementing distributed [[event handling|event-handling]] systems in [[Event-driven programming|event-driven software]]. In such systems, the subject is usually named a "stream of events" or "stream source of events" while the observers are called "sinks of events." The stream nomenclature alludes to a physical setup in which the observers are physically separated and have no control over the emitted events from the subject/stream source. This pattern thus suits any process by which data arrives from some input that is not available to the [[CPU]] at [[Booting|startup]], but instead may arrive at arbitrary or indeterminate times ([[HTTP request]]s, [[GPIO]] data, [[user input]] from [[peripheral]]s and [[distributed database]]s, etc.).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)