[Zope-PTK] PropertySheets

Mike Pelletier mike@digicool.com
Wed, 9 Feb 2000 18:18:23 -0500 (EST)


    I think I have this worked out.  Let me know what you think.

    I've done some reading in OFS/PropertySheets, and it seems to me that
the FixedShema class (a PropertySheet subclass) accepts as a constructor
arguement another PropertySheet, which it uses as it's schema and for
default values.  It would be trivial to subclass this in such a way that
it can ask a UserStore for it's values, and to tell the UserStore when it
changes it's values.  For now, let's call this subclass 'LoginSheet'.

    So.  LoginManager is given a PropertySheets object, pstemplates.  
This contains a set of PropertySheets.  This allows the manager to define
a schema and default values with very little work on our part.

    LoginUser is given a PropertySheets object called propertysheets.  
When (or shortly after) a LoginUser is instantiated, it iterates over the
LoginManager's pstemplates, creating a LoginSheet object for each of
pstemplate's PropertySheets.  The LoginSheet calls a method on the
UserStore with the username and propertysheet name as arguments.  The
UserStore method returns a mapping of names to values, which the
LoginSheet uses to populate itself.

    If the fetch-properties and store-property methods don't exist on the
UserStore, they can be aquired from the LoginManager which would provide
the services by stashing the information in it's instance somewhere.  
This way, UserStores don't _have_ to provide this support.  If they don't,
properties are simply stored in the ZODB, and we're no worse off than we
are now.

    Can you see any problems with this scheme?  Looks pretty simple and
doable to me!

-- 
Mike Pelletier                          email: mike@digicool.com
Mild mannered software developer          icq: 7127228
by day, super villain by night.         phone: 519-884-2434