[Zope-dev] ZPatterns design question

Steve Alexander steve@cat-box.net
Mon, 31 Jul 2000 11:02:17 +0100


"Phillip J. Eby" wrote:
> 
> At 11:09 PM 7/30/00 +0100, Steve Alexander wrote:
> >Let's say I have an AddressBook specialist.
> 
> Why?  :)
> 
> Seriously, what is the function of "address book" in your application?  Is
> it to find people in general?  Or...?

As in your example later, the Addresses specialist is at a different
level of abstraction than other specialists.

The domain expert tells me that he want to keep particular information
about Suppliers: what they supply, and their address details. However,
he also wants to store the address details of any other contacts he
wishes. He'll sometimes need to search through all of the contacts and
suppliers (and in future, anyone that has an address) by phone number or
name or address. The domain expert calls the thing that allows him to do
the searching (and also browsing) of addresses his "address book", and
it reflects a real paper-based artifact. I'm sure I could rename it
"Contacts" or "Addresses" without causing too much confusion, though.

From the way I just described it, there is no requirement for the
addresses to be stored all in one place. There is a requirement that you
can search and browse through all addresses, and return the appropriate
object.

So, I guess a good way to go is to add an "address" propertysheet to
Contact and Supplier, and have triggers that add the address details of
both to an Address catalogue.

> >----
> >Bunch of questions:
> >
> >Is this the ZPatterns ideomatic way to do this?
> 
> Dunno.  Explain the problem you're trying to solve, and I'll
> tell you the simplest way I know to do it.
           ^^^^^^^^^^^^^^^^

Aha... the missing link :-)


> >What kind of propertysheet should I be using?
> 
> Depends on what your application needs.  I can see circumstances where the
> best place for that sheet could be LDAP, SQL, or the ZODB.  

I wasn't being very clear there.  What kind of propertysheet should I be
adding to my DataSkin-derived ZClasses?

There are two kinds: "Common instance" and "DataSkin attribute".

It looks to me like at present the "DataSkin attribute" flavour will
work better with SkinScript.


> In which case, I think your
> confusion comes from terminology.  I would expect to store "Contacts" or
> "Entries" in an addressbook, and these would have address sheets, as would
> "Suppliers" or whatever else.

That makes sense. Suppliers are sored in the Suppliers specialist, and
general Contacts are stored in the Contacts specialist. The contacts
specialist provides searching appropriate to the domain of addresses and
contacts.


> Anyway, to answer your question - I think that your getItem() for an
> address specialist wants to return some object with an address sheet.  But
> not an address object.  Contact, Entry, Supplier, TennisBuddy...  whatever
> the heck kind of object it is.

This is starting to make much more sense.

Many thanks.

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