Re: [Zope-PAS] mutable property sheets

2006-04-22 Thread Zachery Bir

On Apr 22, 2006, at 6:45 AM, Jens Vagelpohl wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 22 Apr 2006, at 11:22, Wichert Akkerman wrote:


Hi Jens,

Previously Jens Vagelpohl wrote:

After this somewhat muted discussion I think the best way forward
would be to create a branch and merge whatever you think should be
merged, and then we'll go from there deciding what gets merged back
to the trunk. I'd think almost everything will, with the  
exception of

that contentious magic persistence.


Sounds like an excellent plan. Who should I contact to get commit  
access

to work on that branch?


You don't have commit access for svn.zope.org? Ouch. Hm, I think  
Jim is a good first address. I'm not entirely sure who does what in  
that regard nowadays.


Yes, Wichert will need to sign a contributor's agreement. I *think*  
ZC is still accepting them in the interim while the Foundation is  
getting ironed out, though I'm not positive.


  

Zac

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-22 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 22 Apr 2006, at 11:22, Wichert Akkerman wrote:


Hi Jens,

Previously Jens Vagelpohl wrote:

After this somewhat muted discussion I think the best way forward
would be to create a branch and merge whatever you think should be
merged, and then we'll go from there deciding what gets merged back
to the trunk. I'd think almost everything will, with the exception of
that contentious magic persistence.


Sounds like an excellent plan. Who should I contact to get commit  
access

to work on that branch?


You don't have commit access for svn.zope.org? Ouch. Hm, I think Jim  
is a good first address. I'm not entirely sure who does what in that  
regard nowadays.


jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFESglaRAx5nvEhZLIRAg4OAJ96k9wL2V3b8JDmTTMVBC1SWrTs2QCfbeAJ
GB6iDpmD+PamBIxYUO1/cy0=
=N9c6
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-22 Thread Wichert Akkerman
Hi Jens,

Previously Jens Vagelpohl wrote:
> After this somewhat muted discussion I think the best way forward  
> would be to create a branch and merge whatever you think should be  
> merged, and then we'll go from there deciding what gets merged back  
> to the trunk. I'd think almost everything will, with the exception of  
> that contentious magic persistence.

Sounds like an excellent plan. Who should I contact to get commit access
to work on that branch?

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-22 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16 Apr 2006, at 15:48, Wichert Akkerman wrote:

Is there any reason not to merge the MutablePropertySheets from  
PlonePAS

into PAS? The implementation is quite trivial:

http://dev.plone.org/collective/browser/PlonePAS/trunk/interfaces/ 
propertysheets.py

https://dev.plone.org/collective/browser/PlonePAS/trunk/sheet.py
https://dev.plone.org/collective/browser/PlonePAS/trunk/plugins/ 
property.py


it would certainly be a good step in making PlonePAS slowly  
disappear :)


Wichert,

After this somewhat muted discussion I think the best way forward  
would be to create a branch and merge whatever you think should be  
merged, and then we'll go from there deciding what gets merged back  
to the trunk. I'd think almost everything will, with the exception of  
that contentious magic persistence.


jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFESgJKRAx5nvEhZLIRAs+sAKCLkEiznJ3p0V3rWrI/OUF2oJJNIgCgnUsf
e0WtfYNInyGk7GbxxntaVGQ=
=Yax7
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-20 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 20 Apr 2006, at 14:16, Clemens Robbenhaar wrote:

Basically, the expectation you mention is unrealistic for most user
folders out there.


 Ok, got the point. As I said, I have been arguing from some (dummy?)
end-user perspective. I guess other users can figure out that user
objects are normally not the same as persistent objects, too.

 If I put a developer hat on, I feel an explicit "saveProperties" call
or something like that is better, too - so sorry for the noise I  
created.


No, this is all helpful, don't get me wrong. It just helped me hone  
the argument why this magic is bad, or unexpected.  ;)


jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFER4tURAx5nvEhZLIRAsUeAJ95QKE+xPnrj9V748qtkjJZn3D8AgCfSg8b
aoxpdVswnHqQ7LIWgYWcj94=
=wKd4
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-20 Thread Clemens Robbenhaar
Hi Jens,

 > >  Usually I am not fond of magic either, but from an user point of
 > > view ("user" = someone who might write ZODB Python scripts using  
 > > PAS or
 > > the like) I am used to have all changes to objects saved magically, so
 > > why not user properties?
 > 
 > This is true - if this were a normal persistent object. But that is  
 > only true with a few user folder implementations, like the bog- 
 > standard Zope user folder.
 > 
 > For most user folder implementations the user object cannot counted  
 > as being persistent because it is assembled on the fly using data  
 > from external sources (RDBMS, LDAP, etc). It gets used once (or a few  
 > times if it bis cached internally for speeed) and then thrown away.
 > 
 > Basically, the expectation you mention is unrealistic for most user  
 > folders out there.
 
 Ok, got the point. As I said, I have been arguing from some (dummy?)
end-user perspective. I guess other users can figure out that user
objects are normally not the same as persistent objects, too.
 
 If I put a developer hat on, I feel an explicit "saveProperties" call
or something like that is better, too - so sorry for the noise I created.

Cheers anyway,
Clemens

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-20 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 Usually I am not fond of magic either, but from an user point of
view ("user" = someone who might write ZODB Python scripts using  
PAS or

the like) I am used to have all changes to objects saved magically, so
why not user properties?


This is true - if this were a normal persistent object. But that is  
only true with a few user folder implementations, like the bog- 
standard Zope user folder.


For most user folder implementations the user object cannot counted  
as being persistent because it is assembled on the fly using data  
from external sources (RDBMS, LDAP, etc). It gets used once (or a few  
times if it bis cached internally for speeed) and then thrown away.


Basically, the expectation you mention is unrealistic for most user  
folders out there.


jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFER4dXRAx5nvEhZLIRAk65AKCwfD9r9u3iKiLRfYEOn7zQbIMP7wCgtOmU
twbDkZxwFNvAzQ4E7IM8Zm8=
=KIvd
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-18 Thread Clemens Robbenhaar

Jens Vagelpohl writes:
 > 
 > So my own opinion is that I don't like the persistence magic for  
 > setting properties. IMHO the methods on the properties plugins should  
 > be called explicitly instead of automatically whenever anyone touches  
 > one of these mutable property sheets.
 > 
 > This is just one opinion, I hope others will chime in as well.

 Just because I feel asked for my opinion:

 Usually I am not fond of magic either, but from an user point of
view ("user" = someone who might write ZODB Python scripts using PAS or
the like) I am used to have all changes to objects saved magically, so
why not user properties?

 But that is just an user point of view, I would not count too much on
my own opinion myself here. 

my 2 cents,
Clemens

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-17 Thread Chris McDonough
- - setting properties on a user will magically turn around and  
persist

the change. This would be the first user folder I have seen where
this happens. Personally, I'm a bit uncomfortable with this magic.


setProperty on GRUFUser will persist the change as well.


I'm uncomfortable with this as well.  I think this should be a local  
policy choice, not a feature of PropertiedUser.  Maybe one reason  
that PlonePAS shouldn't die is to provide a specific kind of user  
object where this feature is in effect?


- C

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-16 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16 Apr 2006, at 18:27, Wichert Akkerman wrote:


Previously Jens Vagelpohl wrote:

I hate to say it, but GRUF isn't an example for anything right or
good when it comes to user folders. And that opinion goes right up to
the top in Plone circles.


No argument there. But considering how popular GRUF is its  
behaviour is

a good measure of what people are used to.


IMHO this makes that specific behavior a candidate for being in the  
Plone layer as opposed to the PAS layer. Or at least set up in PAS so  
it is not the default behavior.




So my own opinion is that I don't like the persistence magic for
setting properties. IMHO the methods on the properties plugins should
be called explicitly instead of automatically whenever anyone touches
one of these mutable property sheets.


That makes your code very verbose though. For all changes you have to
figure out which plugin the property belongs to, figure out which user
folder should be used, get the plugin from that userfolder and call a
method on that.


There's two specific reasons I have for not liking it. First of all,  
it's magic. Magic is  just plain bad in my book. Simple and explicit  
is better. Secondly, I fear implementations inadvertently writing  
more than necessary into a potentially expensive data store (think  
RDBMs, LDAP, etc).


jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEQnJvRAx5nvEhZLIRAlaJAJ4rBJNdO3GNwVXrGbdvc/jLZI8iHwCdFrdz
9UHkGKDXNfTxgtBWXr575wY=
=xt3t
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-16 Thread Wichert Akkerman
Previously Jens Vagelpohl wrote:
> I hate to say it, but GRUF isn't an example for anything right or  
> good when it comes to user folders. And that opinion goes right up to  
> the top in Plone circles.

No argument there. But considering how popular GRUF is its behaviour is
a good measure of what people are used to.

> So my own opinion is that I don't like the persistence magic for  
> setting properties. IMHO the methods on the properties plugins should  
> be called explicitly instead of automatically whenever anyone touches  
> one of these mutable property sheets.

That makes your code very verbose though. For all changes you have to
figure out which plugin the property belongs to, figure out which user
folder should be used, get the plugin from that userfolder and call a
method on that.

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-16 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16 Apr 2006, at 17:46, Wichert Akkerman wrote:


Previously Jens Vagelpohl wrote:

- - IMutablePropertiesPlugin.getPropertiesForUser deviates from the
original contract in IPropertiesPlugin.getPropertiesForUser and
returns a property sheet object instead of a mapping. IMHO it should
return a mapping.


It has to return an object so it can persist property changes.


Ah, right, that's how something is retrieved that will actuate the  
magic. Ugh.



- - setting properties on a user will magically turn around and  
persist

the change. This would be the first user folder I have seen where
this happens. Personally, I'm a bit uncomfortable with this magic.


setProperty on GRUFUser will persist the change as well.


I hate to say it, but GRUF isn't an example for anything right or  
good when it comes to user folders. And that opinion goes right up to  
the top in Plone circles.


So my own opinion is that I don't like the persistence magic for  
setting properties. IMHO the methods on the properties plugins should  
be called explicitly instead of automatically whenever anyone touches  
one of these mutable property sheets.


This is just one opinion, I hope others will chime in as well.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEQm5bRAx5nvEhZLIRAnbYAJ47QaUil6WWiQ6MM9syC1d65OwFegCgpImW
CGbDwcwX/XSFnYTXRJ5NjE8=
=KRrT
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-16 Thread Wichert Akkerman
Previously Jens Vagelpohl wrote:
> - - IMutablePropertiesPlugin.getPropertiesForUser deviates from the  
> original contract in IPropertiesPlugin.getPropertiesForUser and  
> returns a property sheet object instead of a mapping. IMHO it should  
> return a mapping.

It has to return an object so it can persist property changes. 

> - - IPropertiesPlugin.setPropertiesForUser claims to only accept a  
> propertysheet object, but it would probably work fine with a simple  
> mapping (eyeballing the implementation in the  
> ZODBMutablePropertyProvider class). The contract could be changed to  
> accept mappings.

Indeed, I'll update the contract to that effect.

> - - setting properties on a user will magically turn around and persist  
> the change. This would be the first user folder I have seen where  
> this happens. Personally, I'm a bit uncomfortable with this magic.

setProperty on GRUFUser will persist the change as well.

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] mutable property sheets

2006-04-16 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16 Apr 2006, at 16:48, Wichert Akkerman wrote:

Is there any reason not to merge the MutablePropertySheets from  
PlonePAS

into PAS? The implementation is quite trivial:

http://dev.plone.org/collective/browser/PlonePAS/trunk/interfaces/ 
propertysheets.py

https://dev.plone.org/collective/browser/PlonePAS/trunk/sheet.py
https://dev.plone.org/collective/browser/PlonePAS/trunk/plugins/ 
property.py


A couple things I noticed:

- - IMutablePropertiesPlugin.getPropertiesForUser deviates from the  
original contract in IPropertiesPlugin.getPropertiesForUser and  
returns a property sheet object instead of a mapping. IMHO it should  
return a mapping.


- - IPropertiesPlugin.setPropertiesForUser claims to only accept a  
propertysheet object, but it would probably work fine with a simple  
mapping (eyeballing the implementation in the  
ZODBMutablePropertyProvider class). The contract could be changed to  
accept mappings.


- - setting properties on a user will magically turn around and persist  
the change. This would be the first user folder I have seen where  
this happens. Personally, I'm a bit uncomfortable with this magic.


Just my 2 ยข.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEQmIxRAx5nvEhZLIRApvDAJ0f/T021SNDzq+sgVSMNaRKCotTXwCdFy1W
ScpwyruPB0bhk2XAomp5rX8=
=1Mxw
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas