Closed Bug 19321 Opened 25 years ago Closed 25 years ago

implement RDF resource pseudo-aggregation

Categories

(Core Graveyard :: RDF, defect, P1)

defect

Tracking

(Not tracked)

CLOSED FIXED

People

(Reporter: waterson, Assigned: waterson)

Details

per alecf, scottip, and my discussion, I think we agreed to: 1. Add GetDelegate() and ReleaseDelegate() methods to nsIRDFResource. GetDelegate() will look kind of like QueryInterface(), but will take a 'const char*' key, and an IID. 2. Each RDF resource will maintain a table of "delegate" objects, indexed using a user-defined 'const char*' key. 3. GetDelegate() will search the table for an object with a matching key. If it finds the object, it will return it, after QI()-ing the object to the specified IID. If no object is found for the specified key, it will attempt to create an object using a ProgID that is constructed by combining the key with the resource's URI's scheme; e.g. component://rdf-delegate?key=nscp-mailnews;scheme=imap It will store the resulting object in the resource's table. 4. Actually, the creation is a bit more involved. The ProgID will be used to find an XPCOM factory; the factory will be QI()-ed to nsIRDFDelegateFactory, which has a CreateInstance() method which accepts the full URI of the resource for which the delegate is being created. This allows the factory to parse the URI, and create different delegates based on information other than the URI's scheme. 5. The lifetime of the delegate and the RDF resource will be bound together. The delegate must forward all AddRef() and Release() calls to the RDF resource. We'll copy XPCOM's aggregation to get this right. 6. If the delegate wants to "go away" before the RDF resource goes away (e.g., mailnews is being unloaded), then the delegate uses the ReleaseDelegate() method to unbind itself.
Status: NEW → ASSIGNED
Priority: P3 → P1
Target Milestone: M12
I'm looking forward to this. I'm seeing this come up and more and more where we don't want a mail resource created if we don't have to.
just to add a detail so that putterman isn't confused: the const char* in the mail case would be something like "msg-folder" or "msg-message" or "msg-mailfilter" ...basically any object that we'll be reflecting into RDF gets a msg-<objectname>
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
RDF-side stuff is implemented. Now we need to play around with mailnews resources to get this to work. Somebody open another bug for that.
Blocks: 20203
Status: RESOLVED → CLOSED
development issues - closing based on engineer's comments - please re-open if necessary
No longer blocks: 20203
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.