Observing properties associated with an object in an object-oriented programming platform
Abstract
An application programming interface is provided in an object-oriented programming platform for developing applications. A method comprises registering a first object with a second object to observe one or more properties associated with the second object, the second object having a set of methods associated therewith and replacing a first implementation of a method in the set of methods associated with the second object with a second implementation of the method that automatically sends a notification to the first object. The observable objects need not explicitly invoke the observer notifications, avoiding writing of a large amount of code. These observer notifications need only be sent for objects that are actually being observed but are related objects, substantially reducing the performance overhead of needless invocations of the observer notifications without limiting binding between objects.
Claims
exact text as granted — not AI-modified1 . A method for providing an application programming interface in an object-oriented platform, the method comprising:
registering a first object with a second object to observe one or more properties thereof, said second object having a set of methods associated therewith, wherein registering comprises passing a key path related to the one or more properties; and replacing a first implementation of a method in the set of methods of said second object with a second implementation of the method that automatically invokes a notification to said first object from said second object.
2 . A method, as set forth in claim 1 , further comprising:
providing the set of methods in a class of said second object; and locating the method whose name follows a specific pattern in the set of methods of said second object.
3 . A method, as set forth in claim 2 , further comprising:
providing the second implementation of the method with an ability to perform substantially the same operation as the first implementation of the method.
4 . A method, as set forth in claim 1 , wherein replacing a first implementation of a method further comprising:
automatically invoking a first method at an appropriate time to indicate that a valve for a key associated with said second object will change; and automatically invoking a second method at an appropriate time to indicate that the value for the key did change.
5 . A method, as set forth in claim 4 , further comprising:
invoking the first implementation of the method.
6 . A method, as set forth in claim 4 , further comprising:
after a change in the value, automatically providing a new value for the key of a property of said one or more properties to said first object from said second object.
7 . A method, as set forth in claim 4 , further comprising:
before a change in the value, automatically providing an old value for the key of a property of said one or more properties to said first object from said second object.
8 . A method, as set forth in claim 1 , further comprising:
determining relationships of said second object to other objects; and in response to a change in a relationship between said second object and at least one of said other objects, indicating only the change in the relationship of said at least one object and said second object within the notification.
9 . A method, as set forth in claim 8 , further comprising:
generating a single notification from said second object to said first object for a change in status of at least two objects of said other objects.
10 . A method, as set forth in claim 9 , further comprising:
causing the change in status of said at least two objects of said other objects including at least one of insertion, removal and replacement of said at least two objects.
11 . A method, as set forth in claim 2 , further comprising:
allowing the class of said second object to declare that a value of at least one property of said one or more properties depends upon and gets affected by a value of another property of said one or more properties.
12 . A method, as set forth in claim 1 , further comprising:
registering an object class as an observer of a plurality of related objects in a batch that performs a common overhead associated with registration of said plurality of related objects only once.
13 . A method, as set forth in claim 1 , further comprising:
deregistering an object class as an observer of a plurality of related objects in a batch that performs a common overhead associated with deregistration of said plurality of related objects only once.
14 . A method, as set forth in claim 1 , further comprising:
determining an association of said second object with a class; determining an attribute of said second object being a property of said class; identifying a key path linking said second object and said attribute; and observing said property by observing the attribute identified by said key path.
15 . A method, as set forth in claim 1 , further comprising:
upon registration of said first object, allowing said first object being observer of a property of said one or more properties of said second object to be notified immediately of a value of the observed property.
16 . A method, as set forth in claim 1 , further comprising:
causing one or more key-value observing notifications to said first object in response to one or more key-value coding messages to said second object.
17 .- 32 . (canceled)
33 . An object-oriented computing system, the system comprising:
a processor; a memory coupled to said processor, said memory storing a data file structure including an identification of a first and a second object in a software program, one or more properties and a set of methods associated with respective said first and second objects and instructions for registering said first object with said second object to observe said one or more properties thereof, wherein registering comprises passing a key path related to said one or more properties; and a user interface for enabling a user to replace a first implementation of a method in the set of methods of said second object with a second implementation of the method that automatically invokes a notification to said first object from said second object.
34 . The object-oriented computing system of claim 33 , wherein said software program is an operating system program.
35 . The object-oriented computing system of claim 33 , wherein said user interface comprises:
a window that is displayed on a display device of the computing system.
36 . The object-oriented computing system of claim 33 , wherein said data file structure comprises:
a database in which each object of said first and second object forms the basis for a record in the database, and each record contains fields which respectively identify the pointers and the methods with which the record is associated.
37 .- 40 . (canceled)Join the waitlist — get patent alerts
Track US2011225599A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.