Re: [Zope] ZPatterns: Deleting objects from a Rack?

2000-06-29 Thread Chris Withers

Bill Anderson wrote:
 What happens when the object is in multiple racks?
 (Assuming it is possible)

Then it'll be missing if something tries to get it from a rack. The same
thing as would happen if something tried to get it from a single rack
after it'd been deleted. So this case should be covered anywhere as it's
essentially 'what happens if an object that doesn't exist is requested
from a rack?'

That said, can you give em an example where it would eb useful to have
one object stored in multiple racks?

cheers,

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ZPatterns: Deleting objects from a Rack?

2000-06-29 Thread Chris Withers

Scott Parish wrote:
 Another thought i just had was that if you deleted by placing a call to the
 Rack, then you couldn't allow the class to override manage_delete.  You might
 want to do such (overriding) if you wanted it to clean up a catalog or perform
 some other auxiliary function before disappearing.

What class are you talking about? ;-)

This is why I said it might be useful for the rack's delete just to call
delete on the object. I think this is me going on about the demeter's
Law thing again...

cheers,

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ZPatterns: Deleting objects from a Rack?

2000-06-28 Thread Scott Parish

Thus spake Chris Withers ([EMAIL PROTECTED]):

 Ty Sarna wrote:
  call the manage_delete() method on the object. That is, you ask the
  object to delete itself.
 
 This seems unnecessarily long-winded to me. What are the reasons for it
 being like this? (examples are good... ;-)
 
  However, once you have the object, operations on the object should be
  done as methods on the object.
 
 I'm sure it's against Demeter's Law (I've read the Wiki ;-) to work this
 way. You should ask the rack to delete an object and it can process this
 how it wants... most often this would be by asking the object to delete
 itself, but maybe it's be more efficient for the rack to just delete the
 object (for example, if the object is actually a row in an SQL table)
 

I could be mistaken about this, as I'm still having trouble following the
ZPatterns train of thought, but I think the reason that the object needs to
delete itself is that the object may not be stored in a single place.  For
instance, the object might be created from 5 rows from seperate tables in
an SQL db and 2 attributes gotten from LDAP.  I'm not entirely clear how
asking the object to delete itself in this case is going to improve the
situation over just asking the rack to, but I think that was the intent.

sRp

-- 
Scott Parish
http://srparish.net

 PGP signature


Re: [Zope] ZPatterns: Deleting objects from a Rack?

2000-06-28 Thread Chris Withers

Scott Parish wrote:
 I'm not entirely clear how
 asking the object to delete itself in this case is going to improve the
 situation over just asking the rack to, but I think that was the intent.

Okay, I see the intent now too, but I agree with you that I can't see
what advantage asking the object to delete itself provides. Could
someone explain please?

Furthermore, even if there was an advantage to this, why can't the
rack's delete method just be piped through to the object's delete
method? (which I thought was common practice with Specialists)

cheers,

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ZPatterns: Deleting objects from a Rack?

2000-06-28 Thread Bill Anderson

Chris Withers wrote:
 
 Scott Parish wrote:
  I'm not entirely clear how
  asking the object to delete itself in this case is going to improve the
  situation over just asking the rack to, but I think that was the intent.
 
 Okay, I see the intent now too, but I agree with you that I can't see
 what advantage asking the object to delete itself provides. Could
 someone explain please?
 
 Furthermore, even if there was an advantage to this, why can't the
 rack's delete method just be piped through to the object's delete
 method? (which I thought was common practice with Specialists)
 
 cheers,

What happens when the object is in multiple racks?
(Assuming it is possible)

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZPatterns: Deleting objects from a Rack?

2000-06-21 Thread Jeff Hoffman

Ok, I have a stupid question.

I have succeeded in creating a ZClass (a subclass of DataSkin) and
instantiating a few instances in the defaultRack of my Specialist using
my Specialist's newItem() method. Rock.

However, search as I might, I cannot figure out how to delete an item
once it's been created. On gut instinct, I figured there would be a
deleteItem() to complement the newItem() method. No such luck.

What am I missing? Is there a management tab I'm not clicking on 
somewhere? A method I haven't found? A clue I don't have? :-)

Thanks,

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )