[Zope-dev] ZPatterns design question

Steve Alexander steve@cat-box.net
Sun, 30 Jul 2000 23:09:27 +0100


Let's say I have an AddressBook specialist.

It stores Address records as DataSkin-derived ZClass instances
(meta_type Address).

The AddressBook has various methods to list the addresses, search the
addresses, enter new addresses.

The Address ZClass has a single propertysheet: address.

When I add a new Address, a Trigger causes the AddressBook's catalog to
catalog the new address. When I delete an address, it gets removed from
the catalog.


Let's say I want to combine my AddressBook with a Suppliers specialist.
The Suppliers specialist knows about DataSkin-ZClasses called Supplier.
A Supplier has its own propertysheet "supplies" that has information
about the kind of goods and services supplied. A Supplier also has an
address.

Suppliers appear in the AddressBook. When I get a Supplier from the
Suppliers specialist, I want it to have two propertysheets: supplies and
address.

----
Implementation:

When I create a new Supplier, I also create a new Address in the
AddressBook that has the same key (read "id") as the new Supplier.

The Suppliers specialist has some sort of SheetProvider that either asks
the AddressBook for the "address" sheet for a particular key, or (not so
good) delegates directly to the Rack where the Address objects are
stored.

----
Bunch of questions:

Is this the ZPatterns ideomatic way to do this?

Can I use SkinScript to get propertysheets from another specialist?

Is the SheetProvider that gets the address for the Supplier objects also
responsible for adding and deleting Address objects?

Do I need an Address object for each Supplier object?

What kind of propertysheet should I be using?

Should the method in the AddressBook specialist be returning an Address
object, or just an address propertysheet?


Or, more generally: Adding sheets to a "party" seems to be one of the
important ZPatterns ideas. What is the best way of implementing it,
using the simple case of two specialists as an example?


Thanks.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net