[Zope3-dev] Back to Job editing
Jim Fulton
jim@zope.com
Wed, 04 Sep 2002 18:27:41 -0400
Jeffrey P Shell wrote:
> On Tuesday, September 3, 2002, at 11:28 PM, Magnus Heino wrote:
>
>>
>>>> Which makes a degree of sense - it's easier to protect a single
>>>> 'update'
>>>> method than to allow direct attribute setting. But, with Schema and
>>>> Python 2.2+ Properties, is it still the right way?
>>>
>>>
>>> I hope the right way will change with these new things, but we're
>>> currently
>>> in a phase where we're grasping around for idioms concerning this.
>>> The broader question is "should I make this a property or a method?".
>>>
>>> In theory properties/schema help with introspection and I think the code
>>> can look more readable too.
>>
>>
>> Will it be easy to extend existing types with new properties too?
>
>
> There's the Annotations system, which I haven't looked at at all (is it
> implemented yet?).
Yes.
> This is the other avenue I want to explore with what I've been playing
> with with JobBoardEx and my extensions - instead of the JobList class
> instantiating the instances of the local Job class directly, it queries
> for an IJob factory to stamp out a new Job instance. This would allow
> me to subclass and extend Job, while still fitting in with the
> expectations of its container, JobList. This should be possible today,
> but I have no idea how to spell it. Or maybe adapters are the right
> way... *shrug*
You may want to do this, but the JobBoardEx author may not want you to.
This is their privaledge. IMO, It's perfectly OK for someone to provide
non-extensible containers. Something I like about the job board is that it's
an example of a very simple product that isn't heavily loaded with framework
dependencies.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (888) 344-4332 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org