Re: [Zope-dev] Utility factory handling for zope.component

2008-07-23 Thread Wichert Akkerman

Stephan Richter wrote:

On Wednesday 23 July 2008, Wichert Akkerman wrote:
   

If there are no objections I intend to merge the branch to trunk in a
few days
 


I am uncomfortable with the way you approached this. I think there are at
least two other possibilities that I can see without having looked closer:

1. Use the info object. The point of the info is to contain this sort of
information.
   


Which info object are you referring to? The only information I could see 
for utility registration is a tuple, not an object. This is used to 
build the UtilityRegistration object when querying registration 
information, and I added a factory method there.



2. Make the component have a "factory" attribute. I have done this at some
places for APIDOC as well.
   


Why would a component need to know how it was created? I can envision 
that a component may very well have an attribute named factory for 
something else entirely.


Wichert.

--
Wichert Akkerman<[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/  It is hard to make things simple.

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


Re: [Zope-dev] Utility factory handling for zope.component

2008-07-23 Thread Stephan Richter
On Wednesday 23 July 2008, Wichert Akkerman wrote:
> If there are no objections I intend to merge the branch to trunk in a
> few days

I am uncomfortable with the way you approached this. I think there are at 
least two other possibilities that I can see without having looked closer:

1. Use the info object. The point of the info is to contain this sort of 
information.

2. Make the component have a "factory" attribute. I have done this at some 
places for APIDOC as well.

Option 1 seems the cleanest because it was designed d for this.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. "Zope Stephan Richter"
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Utility factory handling for zope.component

2008-07-23 Thread Wichert Akkerman
Tools like GenericSetup which deal with mangement of utility
registration are a bit handicapped at the moment: even though you can
register a utility using a factory the utility registration itself
only runs the factory methods but does not keep any information on it.
As a result you can not round-trip utility registration information or
check if the current configuration has changed from an original
configuration. 

To fix that I made a wichert-utility-factories branch of zope.component
which adds the factory information to the utility registration. All
changes are fully backbwards compatible at both the API and persistence
level.

If there are no objections I intend to merge the branch to trunk in a
few days.

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )