Listener Object Change Detection in Extensible Runtime Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In extensible object management architectures, developers face challenges in managing changes to persistent data due to lack of knowledge about new commands added by third-party developers, leading to difficulties in observing and reacting to changes effectively, which can result in errors and performance issues.
Innovation Solution
A method is introduced where a listener object is used to receive notifications about changes to persistent data by registering with a messaging system, allowing it to make a private copy of the data and react only when the transaction is complete, thereby simplifying the process of building dependent subsystems and reducing errors and reactions to changes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a subject-observer mechanism is used to notify listeners of object changes, then listeners can be informed of changes to persistent data, but listeners cannot reliably detect changes caused by new commands added by third-party developers since the commands are unknown in advance
Solution Approach 1:
The system implements a feedback mechanism where listeners register their interest in specific interfaces, and the system automatically notifies them when those interfaces are modified by any command (including new third-party commands). This closes the information loop, ensuring listeners receive reliable notifications about all changes regardless of command origin.
Solution Approach 2:
The notification system is designed to be universal, handling not only traditional subject-observer notifications but also automatically detecting and notifying about changes caused by new or unknown commands. The same infrastructure serves both known and unknown command types, making the system adaptable to future extensions while maintaining reliability.
2Loss of time
If notifications are sent to listeners for every Dirty() call during a transaction, then listeners are promptly informed of changes, but performance degrades with long command sequences due to excessive notification overhead
Solution Approach 1:
Instead of continuously notifying listeners with every Dirty() call, the system uses periodic action by batching notifications and sending them at transaction commit time. This reduces the frequency of notifications from potentially many times per transaction to once per transaction, significantly improving performance while maintaining timely notification through the use of transactional semantics.
Solution Approach 2:
The system performs preliminary action by tracking all Dirty() calls during the transaction and preparing notification data in advance. This allows the system to accumulate change information efficiently during the transaction and then deliver comprehensive notifications in a single operation at commit time, avoiding repeated notification overhead.
3Ease of operation
If developers use traditional subject-observer mechanisms with known commands, then they can effectively monitor and react to changes, but they face difficulties when new commands are added by third-party developers since the observers have no knowledge of these new commands
Solution Approach 1:
The system introduces an intermediary layer (the automatic notification mechanism) between the commands and the listeners. This intermediary automatically translates any interface modification (regardless of which command caused it) into standardized notifications that listeners can understand and react to, eliminating the need for listeners to have prior knowledge of specific command types.
Solution Approach 2:
The notification system provides self-service by automatically detecting which interfaces have been modified and notifying the appropriate listeners without requiring manual configuration or knowledge of the specific commands involved. The system serves itself by tracking its own state changes and autonomously generating notifications.
Data Source
AI summary
A method includes receiving input indicating a listener object and an interface for an object class corresponding to a persisted object of an object model retained by a database, where the interface has multiple different implementations within the object model; recording information indicating that the listener object has an interest in persistent data associated with the interface for the object class corresponding to the persisted object; in connection with a transaction with the database and when each of multiple calls is received for the database, checking whether the interface for the object class corresponding to the persisted object is associated with the call, wherein each of the calls alerts the database to changes for data managed by the database; and communicating with the listener object when the interface for the object class corresponding to the persisted object was associated with at least one of the calls during the transaction.


