Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-15 Thread Dominik Huber
James Allwyn wrote: used the following to get it to also provide this as a property: rating = property(getRating) Yes, but I would not offer both. I would limit the interface to the property only, because the property can used more easily generating generic view such as schemadisplay,

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-15 Thread James Allwyn
Hello again, (order of quoted sections changed) > >* Is is possible to access the output of an adapter > >directly from ZPT? > > > >I would like to change from view/rating to > >context/rating or context/getRating in the > >ZPT - this would seem cleaner and more > >logical to me - I could do aw

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-15 Thread Dominik Huber
James Allwyn wrote: Thanks Stephan and Dominik for all the help so far. I've decided to go down the route Stephan suggested, since I was more able to get my head around it. I've got a question about adapters / ZPT: * Is is possible to access the output of an adapter directly from ZPT? Ther

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-14 Thread James Allwyn
Thanks Stephan and Dominik for all the help so far. I've decided to go down the route Stephan suggested, since I was more able to get my head around it. I've got a question about adapters / ZPT: * Is is possible to access the output of an adapter directly from ZPT? My adapter provides a method g

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-12 Thread Dominik Huber
Stephan Richter wrote: On Friday 12 August 2005 04:20, Dominik Huber wrote: Your question points out the general problematic the implementation decision between classification and composition. Zope 3 has the power to reduce an object to its *pure* identity and implement all further functiona

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-12 Thread Stephan Richter
On Thursday 11 August 2005 06:36, James Allwyn wrote: > If so, I guess we will be building an adapter along > similar lines to the size adapter both Stephan and > Phillip use as an example in their books - maybe > create an IRating interface, and create adapters for > each of the sub-classes to ada

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-12 Thread Stephan Richter
On Friday 12 August 2005 04:20, Dominik Huber wrote: > Your question points out the general problematic the implementation > decision between classification and composition. Zope 3 has the power to > reduce an object to its *pure* identity and implement all further > functionality by adapters and a

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-12 Thread Dominik Huber
Hi James A few other thoughts... James Allwyn wrote: I would appreciate any guidance on what the recommended Zope3-ish way of handling this would be. I feel the options are either to create a generic IProperty object, and subclass it to IHouse, ICateredHall, ISelfCateredHall, IHomeStay, or what

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-11 Thread James Allwyn
Hi, Thanks for the quick response. I think I get this - because the real world objects that my Zope objects are representing really are sub classes of 'Accommodation', it makes sense to use sub-classes to represent them. This is the "in any system" part of your categorisation - they really are su

Re: [Zope3-Users] To Subclass, or to Adapt?

2005-08-10 Thread Stephan Richter
On Wednesday 10 August 2005 14:01, James Allwyn wrote: > I would appreciate any guidance on what the > recommended Zope3-ish way of handling this would be. I > feel the options are either to create a generic > IProperty object, and subclass it to IHouse, > ICateredHall, ISelfCateredHall, IHomeStay,