[Zope] ZPatterns: Deleting objects from a Rack?

Scott Parish sRp@srparish.net
Wed, 28 Jun 2000 15:15:34 +0000


--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Thus spake Chris Withers (chrisw@nipltd.com):

> Ty Sarna wrote:
> > call the manage_delete() method on the object. That is, you ask the
> > object to delete itself.
>=20
> This seems unnecessarily long-winded to me. What are the reasons for it
> being like this? (examples are good... ;-)
>=20
> > However, once you have the object, operations on the object should be
> > done as methods on the object.
>=20
> 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)
>=20

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

--=20
Scott Parish
http://srparish.net

--BXVAT5kNtrzKuDFl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (OpenBSD)
Comment: For info see http://www.gnupg.org

iD4DBQE5WhaHQIKxCnswXL0RAeN8AJjMiiqO0z1g9RxTWVzqMArmlYLsAJ9GlSrp
aB8MmRhVYA5jBot1P+PrTw==
=7ERx
-----END PGP SIGNATURE-----

--BXVAT5kNtrzKuDFl--