Re: [Zope-dev] Pointer or reference object
I meant to use resolve_url, to find any references to an object upon it's deletion. Changes in an object's state really wouldn't matter if there is a way to truely 'mirror' an object. The name spaces would have to either be selectable, or since it is a mirror, then it aquires the name space of the object that it is mirroring (and exact mirror). Like I said, I don't have any idea if this 'pointer' is even possible in the ZODB. Anyone from DC thinkning about this? All my best, Jason Johan Carlsson writes:
Yes, I have thought about it.
One solution I thought of is use an object referens counter base class for "referencable objects". The base class should be responsible for manageing references and take action on the references when the objects state changes.
One problem is how to handle acqusition. Should the referenced object be viewed in it's own context or the reference objects context? Or should the contexts merge?
How did you intend to use ZCataloges for the ZMirror?
//Johan
Zopsters,
This is very out of the blue, but has anyone thought about tackling the 'reference' question by using a phantom Zope object? I don't know nearly enough Python to answer this question, but maybe someone can.
Is it possible to create a 'Reference' object that really stores the url of another object and maquerades as the other object's meta_type. Anything that is asked of the 'Reference' object, just get's passed along to the real object in it's place? Obviously whenever you delete an object any 'References' with that object's url stored in them get deleted too(ZCatalog could hold these). Sort of like a reflective mirror. You see the object in the mirror but you aren't actually looking at the object, you are looking at the mirror. A ZMirror.
All my best,
-- Jason Spisak 444@hiretechs.com
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
One problem with having a reference count base class that's responsible for inactivate/delete the reference object is that Zope lacks a event model. If a folder/container is deleted it doesn't inform its siblings before it's deleted. And that may lead to invalid reference objects. I think ZCatalog have the same problem? There is a pointer product in the download section, have you looked at it? //Johan
I meant to use resolve_url, to find any references to an object upon it's deletion. Changes in an object's state really wouldn't matter if there is a way to truely 'mirror' an object. The name spaces would have to either be selectable, or since it is a mirror, then it aquires the name space of the object that it is mirroring (and exact mirror). Like I said, I don't have any idea if this 'pointer' is even possible in the ZODB. Anyone from DC thinkning about this?
All my best,
Jason
Johan Carlsson writes:
Yes, I have thought about it.
One solution I thought of is use an object referens counter base class for "referencable objects". The base class should be responsible for manageing references and take action on the references when the objects state changes.
One problem is how to handle acqusition. Should the referenced object be viewed in it's own context or the reference objects context? Or should the contexts merge?
How did you intend to use ZCataloges for the ZMirror?
//Johan
Zopsters,
This is very out of the blue, but has anyone thought about
tackling the
'reference' question by using a phantom Zope object? I don't know nearly enough Python to answer this question, but maybe someone can.
Is it possible to create a 'Reference' object that really stores the url of another object and maquerades as the other object's meta_type. Anything that is asked of the 'Reference' object, just get's passed along to the real object in it's place? Obviously whenever you delete an object any 'References' with that object's url stored in them get deleted too(ZCatalog could hold these). Sort of like a reflective mirror. You see the object in the mirror but you aren't actually looking at the object, you are looking at the mirror. A ZMirror.
All my best,
-- Jason Spisak 444@hiretechs.com
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
One problem with having a reference count base class that's responsible for inactivate/delete the reference object is that Zope lacks a event model. If a folder/container is deleted it doesn't inform its siblings before it's deleted. And that may lead to invalid reference objects. I think ZCatalog have the same problem?
There is a pointer product in the download section, have you looked at it?
Opps, it is not in the download sction any more. Anyway, it's a Symbolic Link Product by Ty Sarna at Endicor Technologies, Inc that reference a pointer object to a folder object base on a URL. There is no way to control the acqusition path nor detect object if the object is moved or deleted. Only links to folder are supported (as far as I can see). If you what to play with it I could send you a copy of the tar ball. //Johan
//Johan
I meant to use resolve_url, to find any references to an object upon it's deletion. Changes in an object's state really wouldn't matter if there is a way to truely 'mirror' an object. The name spaces would have to either be selectable, or since it is a mirror, then it aquires the name space of the object that it is mirroring (and exact mirror). Like I said, I don't have any idea if this 'pointer' is even possible in the ZODB. Anyone from DC thinkning about this?
All my best,
Jason
Johan Carlsson writes:
Yes, I have thought about it.
One solution I thought of is use an object referens counter base class for "referencable objects". The base class should be responsible for manageing references and take action on the references when the objects state changes.
One problem is how to handle acqusition. Should the referenced object be viewed in it's own context or the reference objects context? Or should the contexts merge?
How did you intend to use ZCataloges for the ZMirror?
//Johan
Zopsters,
This is very out of the blue, but has anyone thought about
tackling the
'reference' question by using a phantom Zope object? I don't know nearly enough Python to answer this question, but maybe someone can.
Is it possible to create a 'Reference' object that really stores the url of another object and maquerades as the other object's meta_type. Anything that is asked of the 'Reference' object, just get's passed along to the real object in it's place? Obviously whenever you delete an object any 'References' with that object's url stored in them get deleted too(ZCatalog could hold these). Sort of like a reflective mirror. You see the object in the mirror but you aren't actually looking at the object, you are looking at the mirror. A ZMirror.
All my best,
-- Jason Spisak 444@hiretechs.com
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Actually I'd was more thinking along the lines of the referenced object acting just like the object that it's linked to. Meta-type too. <dtml-in "objectValues(['MyApples'])"> will get you the references to any apples in that folder too. It allows you to have an object in two places(being a physical distinction which matters in Zope) without duplicating the filespace and work to create a second object. All my best, Johan Carlsson writes:
One problem with having a reference count base class that's responsible for inactivate/delete the reference object is that Zope lacks a event model. If a folder/container is deleted it doesn't inform its siblings before it's deleted. And that may lead to invalid reference objects. I think ZCatalog have the same problem?
There is a pointer product in the download section, have you looked at it?
Opps, it is not in the download sction any more.
Anyway, it's a Symbolic Link Product by Ty Sarna at Endicor Technologies, Inc that reference a pointer object to a folder object base on a URL.
There is no way to control the acqusition path nor detect object if the object is moved or deleted. Only links to folder are supported (as far as I can see).
If you what to play with it I could send you a copy of the tar ball.
//Johan
//Johan
I meant to use resolve_url, to find any references to an object upon it's deletion. Changes in an object's state really wouldn't matter if there is a way to truely 'mirror' an object. The name spaces would have to either be selectable, or since it is a mirror, then it aquires the name space of the object that it is mirroring (and exact mirror). Like I said, I don't have any idea if this 'pointer' is even possible in the ZODB. Anyone from DC thinkning about this?
All my best,
Jason
Johan Carlsson writes:
Yes, I have thought about it.
One solution I thought of is use an object referens counter base class for "referencable objects". The base class should be responsible for manageing references and take action on the references when the objects state changes.
One problem is how to handle acqusition. Should the referenced object be viewed in it's own context or the reference objects context? Or should the contexts merge?
How did you intend to use ZCataloges for the ZMirror?
//Johan
Zopsters,
This is very out of the blue, but has anyone thought about
tackling the
'reference' question by using a phantom Zope object? I don't know nearly enough Python to answer this question, but maybe someone can.
Is it possible to create a 'Reference' object that really stores the url of another object and maquerades as the other object's meta_type. Anything that is asked of the 'Reference' object, just get's passed along to the real object in it's place? Obviously whenever you delete an object any 'References' with that object's url stored in them get deleted too(ZCatalog could hold these). Sort of like a reflective mirror. You see the object in the mirror but you aren't actually looking at the object, you are looking at the mirror. A ZMirror.
All my best,
-- Jason Spisak 444@hiretechs.com
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jason Spisak wrote:
Actually I'd was more thinking along the lines of the referenced object acting just like the object that it's linked to. Meta-type too.
<dtml-in "objectValues(['MyApples'])"> will get you the references to any apples in that folder too. It allows you to have an object in two places(being a physical distinction which matters in Zope) without duplicating the filespace and work to create a second object.
How about a product with only two methods in the module - manage_addMirror and manage_addMirrorForm. the form lets you choose an object somehow (by URL?) and manage_addMirror simply adds this object? Something like: def manage_addMirror(self, url, REQUEST=None): """Add a Mirror """ ob=REQUEST.resolve_url(url) id=self._setObject(id, ob) if REQUEST is not None: try: u=self.DestinationURL() except: u=REQUEST['URL1'] REQUEST.RESPONSE.redirect(u+'/manage_main') return ''
Johan: When you delete an object in the ZCatalog currently it uncatalogs itself. If you attatch the deref method to the uncatalog method, then should do both upon deletion. I haven't checked that pointer item, but I will right now. All my best,
One problem with having a reference count base class that's responsible for inactivate/delete the reference object is that Zope lacks a event model. If a folder/container is deleted it doesn't inform its siblings before it's deleted. And that may lead to invalid reference objects. I think ZCatalog have the same problem?
There is a pointer product in the download section, have you looked at it?
//Johan
I meant to use resolve_url, to find any references to an object upon it's deletion. Changes in an object's state really wouldn't matter if there is a way to truely 'mirror' an object. The name spaces would have to either be selectable, or since it is a mirror, then it aquires the name space of the object that it is mirroring (and exact mirror). Like I said, I don't have any idea if this 'pointer' is even possible in the ZODB. Anyone from DC thinkning about this?
All my best,
Jason
Johan Carlsson writes:
Yes, I have thought about it.
One solution I thought of is use an object referens counter base class for "referencable objects". The base class should be responsible for manageing references and take action on the references when the objects state changes.
One problem is how to handle acqusition. Should the referenced object be viewed in it's own context or the reference objects context? Or should the contexts merge?
How did you intend to use ZCataloges for the ZMirror?
//Johan
Zopsters,
This is very out of the blue, but has anyone thought about
tackling the
'reference' question by using a phantom Zope object? I don't know nearly enough Python to answer this question, but maybe someone can.
Is it possible to create a 'Reference' object that really stores the url of another object and maquerades as the other object's meta_type. Anything that is asked of the 'Reference' object, just get's passed along to the real object in it's place? Obviously whenever you delete an object any 'References' with that object's url stored in them get deleted too(ZCatalog could hold these). Sort of like a reflective mirror. You see the object in the mirror but you aren't actually looking at the object, you are looking at the mirror. A ZMirror.
All my best,
-- Jason Spisak 444@hiretechs.com
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
In article <000301bf8685$84b21960$ac0aa8c0@tor.torped.se>, Johan Carlsson <johanc@torped.se> wrote:
One problem with having a reference count base class that's responsible for inactivate/delete the reference object is that Zope lacks a event model. If a folder/container is deleted it doesn't inform its siblings before it's deleted. And that may lead to invalid
It looks like recent Zope releases do pass beforeDelete all the way down.
There is a pointer product in the download section, have you looked at it?
Pointer is sort of like the ZMirror mentioned, but I really don't think it's what you want. It was more of an expirement than somthing intended to be useful (it requires a change to Zope to install, for example).
Jason, Ty, Itamar, and others,
Ty: It looks like recent Zope releases do pass beforeDelete all the way down.
Oh, that's good news :-) Just the acquisition part to worry about then...
Pointer is sort of like the ZMirror mentioned, but I really don't think it's what you want. It was more of an expirement than somthing intended to be useful (it requires a change to Zope to install, for example).
No, it's not that I what. But it's a prototype useful for learning from.
Jason: Actually I'd was more thinking along the lines of the referenced object acting just like the object that it's linked to. Meta-type too.
Me too. A reference to a folder would act similar to the pointer product thou.
<dtml-in "objectValues(['MyApples'])"> will get you the references to any apples in that folder too. It allows you to have an object in two places(being a physical distinction which matters in Zope) without duplicating the filespace and work to create a second object.
I don't quite get that? Sorry.
Itamar: How about a product with only two methods in the module - manage_addMirror and manage_addMirrorForm. the form lets you choose an object somehow (by URL?) and manage_addMirror simply adds this object? Something like:
I really like a object browser, like a file browser (explorer, finder, ...) in a regular OS. Not only for this Mirror-Reference Product but general.
def manage_addMirror(self, url, REQUEST=None): """Add a Mirror """ ob=REQUEST.resolve_url(url) id=self._setObject(id, ob) if REQUEST is not None: try: u=self.DestinationURL() except: u=REQUEST['URL1'] REQUEST.RESPONSE.redirect(u+'/manage_main') return ''
What happens to the acquisition of this object? What happens if the object that this object point at gets deleted or moved? (Moved shouldn't be a problem?) I feel strongly for a reference count or a bi-directional reference to solve the problem with reference integrity. But that would probably need a base class for referable objects to derive from. //Johan
Johan Carlsson wrote:
def manage_addMirror(self, url, REQUEST=None): """Add a Mirror """ ob=REQUEST.resolve_url(url) id=self._setObject(id, ob) if REQUEST is not None: try: u=self.DestinationURL() except: u=REQUEST['URL1'] REQUEST.RESPONSE.redirect(u+'/manage_main') return ''
What happens to the acquisition of this object? What happens if the object that this object point at gets deleted or moved? (Moved shouldn't be a problem?)
To the best of my knowledge of how pickling (and therefore ZODB) work, this will work as if you had two references to the object in python, e.g. as if you had done: x = klass() a = x Each one should acquire from its environment correctly, when deleted the other version will still exist, etc.. There may be other problems, and I may be wrong. Consider the following:
import pickle a = 3 x = a l = [a, x] f = open("pickletest", "w") pickle.dump(l, f) f.close() f = open("pickletest", "r") l2 = pickle.load(f) l2 [3, 3] del l2[0] l2 [3]
Of course, the only real way to know is to test it out. -- Itamar S.T. itamars@ibm.net
Johan:
<dtml-in "objectValues(['MyApples'])"> will get you the references to any apples in that folder too. It allows you to have an object in two places(being a physical distinction which matters in Zope) without duplicating the filespace and work to create a second object.
I don't quite get that? Sorry.
I had thought that Itamar's code below created an object that was exactly like the object at the URL. More like a copy. A duplicate. It that right? If so, I was thinking more along the lines of not dulplicating, just deflecting a request for an object to another object already in the ZODB.
Itamar: How about a product with only two methods in the module - manage_addMirror and manage_addMirrorForm. the form lets you choose an object somehow (by URL?) and manage_addMirror simply adds this object? Something like:
I really like a object browser, like a file browser (explorer, finder, ...) in a regular OS. Not only for this Mirror-Reference Product but general.
def manage_addMirror(self, url, REQUEST=None): """Add a Mirror """ ob=REQUEST.resolve_url(url) id=self._setObject(id, ob) if REQUEST is not None: try: u=self.DestinationURL() except: u=REQUEST['URL1'] REQUEST.RESPONSE.redirect(u+'/manage_main') return ''
What happens to the acquisition of this object? What happens if the object that this object point at gets deleted or moved? (Moved shouldn't be a problem?)
I feel strongly for a reference count or a bi-directional reference to solve the problem with reference integrity. But that would probably need a base class for referable objects to derive from.
Johan, what do you mean by reference count? Something that keeps track of all the references in the ZODB in one place. An authority? Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (4)
-
Itamar Shtull-Trauring -
Jason Spisak -
Johan Carlsson -
tsarnaļ¼ endicor.com