Re: [Zope-dev] bug in zpatterns-0.4 ?

2000-07-04 Thread Jephte CLAIN

"Phillip J. Eby" wrote:
 Nope.  The two levels of methods (get/retrieve and new/create) are there to
 seperate Rack-level concerns from implementation concerns.  getItem() and
 newItem() handle maintenance of Rack-level invariants such as the retrieval
 cache, while retrieveItem() and createItem() deal with object-level
 invariants.  If you called retrieveItem() instead of getItem(), the code
 would bypass the rack-level invariants managed by getItem(), which would
 mean in this case that the per-transaction cache would be bypassed.
yes, this is a bit more clear to me now.

 Hm.  Seems to me that you should just use two GAP's, one for each DB table,
 each using "self.id[0]" and "self.id[1]" respectively to determine their
 primary keys.
(cough) why didn't I think about it???

 Also, my racks
 are specialized to have a searchResults method, and a editItem method
 (until I can find the time to write a decent SQL Attribute setter
 provider)
 
 A reasonable approach.  Although, in the case of SQL attribute setting, see
 my other e-mail from this evening about the use of Generic Triggers to do
 SQL attribute setting.
 
 btw, the genericattributeprovider has saved me a great deal of time.
 thanks very much!
 
 No problem.  Did you ever try re-casting your CatalogAwareness replacement
 to use GenericTrigger instead of a specific Agent plug-in?
I did not have the time to do so. I still stick to Zope-2.1.6 for now,
and I was afraid of the issues with transaction commit order. and the
motto is 'if it ain't break, don't fix it'. I have a contract to upgrade
the product in august though. I will look at it at that time.

regards,
[EMAIL PROTECTED]

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




Re: [Zope-dev] bug in zpatterns-0.4 ?

2000-07-03 Thread Phillip J. Eby

At 11:54 AM 6/27/00 +0400, Jephte CLAIN wrote:
mike wrote:
 There is no way to infinite recursion if Rack.getItem is leaved
 untouched. 
Ah ah. But people will touch it. Like me for example :-)
There is no way to prevent overriding getItem from a ZClass for example.
And it *will* recurse infinitely, making Zope dumping core.

 getItem/newItem are not a high level methods, they are *part
 of DataSource's protocol* which *implemented* in Rack with retrieveItem
 and buddies.
getItem/newItem are not meant to be overrided. retrieveItem/createItem
are to overrided. This is different level for me.

When Philipp wake up (I guess he's asleep right now :-)), he might give
his opinion about that.


I've been on vacation.  I'm basically with Mike on this one, with a slight
amplification on my intention here.  IMHO, what you should be doing with
your SQL is making it an AttributeProvider, and using the "virtual" mode of
the Rack which does not store the item in the ZODB, only its
propertysheets.  Then you will not need to override *anything* in any of
the ZPatterns classes.  If you need to store persistent attributes, this
may be an issue.  I'm planning to create a "Persistent External Attribute
Provider" to allow one to store attributes persistently even when the
object itself isn't stored in the ZODB.

In any case, my intention for mixed-database objects in racks is that one
should not need to override any of the built-in methods of Rack.  In
earlier versions of ZPatterns, such overriding seemed like it would be
necessary, but as of 0.4 there is really no reason at the framework level
to mess with any of Rack's implementation details unless you need to create
a special hand-tuned version for some critical bit of efficiency.  Almost
anything you could do by overriding those methods can now be done through
Generic Attribute Providers or other plug-ins.


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




[Zope-dev] bug in zpatterns-0.4 ?

2000-06-27 Thread Jephte CLAIN

hello,

Rack.createItem (low level method) first calls Rack.getItem (higher
level method) to check the existence of the item.
This causes infinite loop in certain cases. It should (IMHO) call
Rack.retrieveItem instead

regards,
jephte clain
[EMAIL PROTECTED]

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




Re: [Zope-dev] bug in zpatterns-0.4 ?

2000-06-27 Thread mike

Jephte CLAIN wrote:
 
 hello,
 
 Rack.createItem (low level method) first calls Rack.getItem (higher
 level method) to check the existence of the item.
 This causes infinite loop in certain cases. It should (IMHO) call
 Rack.retrieveItem instead
 

Could you provide an example please?

Mike

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