Re: [Zope-dev] Object hierarchy in RIPP
Thanks for all of the messages, Phillip. Hopefully, you'll succeed in getting ZPatterns 0.3.0 out the door tomorrow. Even if you don't, when it *does* come out there will probably be many more people that are ready to use it. ----- Original Message ----- From: "Phillip J. Eby" <pje@telecommunity.com> To: "Kevin Dangoor" <kid@kendermedia.com>; <zope-dev@zope.org> Sent: Thursday, May 04, 2000 11:31 AM Subject: Re: [Zope-dev] Object hierarchy in RIPP
At 10:59 AM 5/4/00 -0400, Kevin Dangoor wrote:
I have a database of products, built from ZClasses. Products are bundled into groups for convenience of management, and the URL of a product is based on its SKU. So, we can have a product at products/1/5, and that would be the item 1-5. This direct traversal to a product object is very useful. The products are all indexed in a ZCatalog, and I do use acquisition to get at some useful things for displaying these products.
If I were doing what you're doing, I'd use a Products "Specialist" (fka Implementor). Specialists implement bobo_traverse by asking their enclosed Racks for the item. They also have a methods tab for shared/acquired stuff.
OK. *Now* I'm a lot clearer on how these things should be used. I didn't realize that the Specialists implemented bobo_traverse. I assume that one difference between the Rack and my existing set up is that if I have a Specialist called "products" and go to products/manage I'm not going to see the standard Zope management interface listing out the products. Correct? I understand that Racks are meant to solve some of the issues with having "too many" items in one Folder, in which case you wouldn't *want* the standard Zope management interface. If/when the API defines search methods, it might be nice to create a standard "management interface" for Racks that would let you add instances, search for instances and delete them.
The only bit I'm not sure about is your mapping of 1-5 to 1/5, which seems to me to imply that you have another hierarchy level in there, which Racks don't handle per se. If you have something like a ProductGroup object going on in there, then I would have a ProductGroups specialist retrieve the ProductGroup, whose bobo_traverse would ask the Products specialist to retrieve the product, wrapped with the ProductGroup for acquisition.
You're correct about the "ProductGroup" sort of thing. I will probably eliminate that, since it sounds like Racks will quite comfortably handle lots of items. I see the difference you're getting at, as well. So, I wouldn't try to stuff a Specialist into another Specialist or onto a Rack. The ProductGroups Specialist just asks the Products Specialist for a given item. Makes sense.
That's less than optimal, however. In a future version of ZPatterns, we want to make it possible for RackMountables to live anywhere in the ZODB "file system" and still add propertysheets, etc. Right now, they have to live in a Rack because that's where the external data management is. You could hack this pretty easily, however, by making your Folderish objects bobo_traverse methods call _setRack on retrieved sub-objects, and pointing them to the Rack which is designated for managing their external data. That's sort of how we'll be implementing the extension anyway, only we'll be doing it in a lot more complicated way involving __of__. :)
I agree that this flexibility would be nice... But, I don't mind having to put things in Racks in order to be able to flexibly store information in the ZODB and RDBMSes.
By the way, all my comments refer to ZPatterns 0.3.0, which I hope to release tomorrow. 0.2.0 doesn't have Specialists, for example. 0.3.0 supports arbitrary persistent propertysheets, and has a well-fleshed out API (compared to earlier versions, anyway) for creating attribute providers and sheet providers.
Excellent! Kevin
At 04:10 PM 5/4/00 -0400, Kevin Dangoor wrote:
I assume that one difference between the Rack and my existing set up is that if I have a Specialist called "products" and go to products/manage I'm not going to see the standard Zope management interface listing out the products. Correct?
Correct. You'd see the management interface for editing the specialist, specifically the "Methods" tab. Other tabs exist for "Racks", "Sheet Providers", and "Attribute Providers".
I understand that Racks are meant to solve some of the issues with having "too many" items in one Folder, in which case you wouldn't *want* the standard Zope management interface. If/when the API defines search methods, it might be nice to create a standard "management interface" for Racks that would let you add instances, search for instances and delete them.
Currently that sort of interface is all spec'd by the builder (you). Just add methods on the methods tab for what you want. That also lets you make it more application domain-specific. Specialists are *supposed* to be domain-specific, not merely a place like a folder where you stash your data. Indeed, in your products application, I'd put my front-page menu as the specialist's index_html, with all my add/search/reporting methods there as well. Anything that is like a product method, but which is more a "class" method than an instance method, would go on the Methods tab of the Specialist. The Specialist thus becomes a one-stop-shop for an application building block. Way-in-the-future releases may have some more ability to set up defaults of such things for you, and after we figure out indexing plugins there may be some kind of built-in search capabilities. Meanwhile to implement searching, just use a Catalog, SQL methods, LDAP methods, or whatever else works for you, on the Methods tab of either the Rack (if its a storage-specific mechanism) or on the Specialist (if it works across all the Specialist's racks).
I see the difference you're getting at, as well. So, I wouldn't try to stuff a Specialist into another Specialist or onto a Rack. The ProductGroups Specialist just asks the Products Specialist for a given item. Makes sense.
Right. Nobody should ever talk to a Rack except the Specialist who owns it. In fact, you can't even add a Rack to a folder, you can only add one to a Specialist.
I agree that this flexibility would be nice... But, I don't mind having to put things in Racks in order to be able to flexibly store information in the ZODB and RDBMSes.
Keep in mind that at the moment, you'll have to write your own SQL providers for sheets and attributes. There will be two examples of each kind of provider available in 0.3.0, but they don't do much interesting because they're ZODB and acquisition-based. We'll probably also be implementing LDAPRack and LDAP-attribute/sheet providers before the SQL stuff, because we need the LDAP stuff sooner for company projects.
At 04:10 PM 5/4/00 -0400, Kevin Dangoor wrote:
Thanks for all of the messages, Phillip. Hopefully, you'll succeed in getting ZPatterns 0.3.0 out the door tomorrow. Even if you don't, when it *does* come out there will probably be many more people that are ready to use it.
It's up. We should be doing the official cataloging and announcements by Monday, but for now, you can see them at Members/pje and Members/tsarna on zope.org. Please note that if you're using this with the PTK, the new stuff may break some of Mike P's provisional propertysheets support, on account of we now have some non-provisional support included. :) We'll try to look over the PTK stuff and provide patches in a week or two if somebody else doesn't fix it first. Also note that ZPatterns includes a C extension and we do not include binaries or any easy-build features. If anybody wants to chip in with these it would be helpful for the less build-fortunate out there. :) Have fun, and please do read the install/upgrade docs in both packages before upgrading!
"Phillip J. Eby" wrote:
Have fun, and please do read the install/upgrade docs in both packages before upgrading!
I think you're going to run into a pretty serious documentation need, I honestly haven't been able to understand what's been going on so far, and I was at your RIPP talk. ;) I have created a section of the InterfaceWiki just for you: http://www.zope.org/Members/michel/Projects/Interfaces/ZPatterns And I filled in some structure: http://www.zope.org/Members/michel/Projects/Interfaces/ZPatterns/offspring I can problem sketch out rack and rackmountable, but the plug in stuff is kinda wild. -Michel
At 03:17 PM 5/5/00 -0700, Michel Pelletier wrote:
I think you're going to run into a pretty serious documentation need, I honestly haven't been able to understand what's been going on so far, and I was at your RIPP talk. ;)
From my poor presentation logic at the talk, I would think it might have been more hindrance than help anyway. :)
I have created a section of the InterfaceWiki just for you:
http://www.zope.org/Members/michel/Projects/Interfaces/ZPatterns
And I filled in some structure:
http://www.zope.org/Members/michel/Projects/Interfaces/ZPatterns/offspring
I can problem sketch out rack and rackmountable, but the plug in stuff is kinda wild.
I was in the process of setting up a ZPatterns wiki in my zope.org home, but its focus is more on conceptual introduction to the patterns and how to use them. But I don't suppose that interface docs would be out of place in the interface wiki. :) I'm in the process of moving right now (my house) and may be short on time for several days, so it may be a while before I can add much, though. It appears that you've done some looking at the code; please do let us know if you have any comments or spot any subtle misunderstandings on our part of how the Zope framework is actually supposed to work.
At 04:10 PM 5/4/00 -0400, Kevin Dangoor wrote:
Thanks for all of the messages, Phillip. Hopefully, you'll succeed in getting ZPatterns 0.3.0 out the door tomorrow. Even if you don't, when it *does* come out there will probably be many more people that are ready to use it.
It's up. We should be doing the official cataloging and announcements by Monday, but for now, you can see them at Members/pje and Members/tsarna on zope.org.
Both the packages expand into lib/python and (probably?) need to go into lib/python/Products - at least that seems to be the case for ZPatterns (it has -I../../ZODB -I../../../Components/ExtensionClass in the Setup file). Now to try and figure 'em out! :) cheers Phil and Ty Tone.
At 09:21 AM 5/6/00 +0100, Tony.McDonald@newcastle.ac.uk wrote:
Both the packages expand into lib/python and (probably?) need to go into
lib/python/Products - at least that seems to be the case for ZPatterns (it has -I../../ZODB -I../../../Components/ExtensionClass in the Setup file). Eeek. You're right. I even remember seeing Ty moving them into lib/python to do the tarball and it didn't even occur to me. Yes, they both belong in Products.
In article <200005061610.JAA30978@zope.codeit.com>, Phillip J. Eby <pje@telecommunity.com> wrote:
Eeek. You're right. I even remember seeing Ty moving them into lib/python to do the tarball and it didn't even occur to me. Yes, they both belong in Products.
D'oh! We really do need to write a "make release" for this stuff...
I've posted a version of ZPatterns with the tarball paths fixed, at the same URL as before. At 06:26 PM 5/6/00 +0000, Ty Sarna wrote:
In article <200005061610.JAA30978@zope.codeit.com>, Phillip J. Eby <pje@telecommunity.com> wrote:
Eeek. You're right. I even remember seeing Ty moving them into lib/python to do the tarball and it didn't even occur to me. Yes, they both belong in Products.
D'oh!
We really do need to write a "make release" for this stuff...
That was why I kept saying that after the first mistake we made in the build process. See "makerelease.py" in Vega's homedir. :) In fact, there's a nicely built LoginManager tarball in /tmp/ZRel for you to upload also. :)
In article <200005061954.MAA01774@zope.codeit.com>, Phillip J. Eby <pje@telecommunity.com> wrote:
build process. See "makerelease.py" in Vega's homedir. :) In fact, there's a nicely built LoginManager tarball in /tmp/ZRel for you to upload also. :)
Third time's the charm? :-) I've uploaded the new tarball to zope.org.
participants (5)
-
Kevin Dangoor -
Michel Pelletier -
Phillip J. Eby -
Tony.McDonald@newcastle.ac.uk -
tsarna@endicor.com