RE: [picocontainer-dev] Request: Add public getParameters() to ComponentAdapter interface.

Jörg Schaible <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Hi Michael, 

________________________________

	From: Michael Rimov 
	Sent: Sunday, April 16, 2006 8:16 AM
	Subject: [picocontainer-dev] Request: Add public getParameters() to ComponentAdapter interface.
	
	

	I was working on an updated GroovyScriptGenerator and noticed that it was impossible to write component registrations that had parameters.

	 

	After digging through the source code, AFAICT, there is no way to get at the parameters that were passed in to the registerComponentImplementation()

	methods.

	 

	I would like to propose the new method signature:

	 

	Parameter[] getComponentParameters();

	 

	If no parameters were set during the call, it will return new Parameter[0]; 

	 

	That way, the instantiating component adapters can create their own default parameters if none were sent in, yet it allows querying of what it took to create the picocontainer in the first place.

	 

	Would there be any objections to this addition?
________________________________


IMHO this was suggested before and rejected ... but honestly - I don't remember why. Parameter is part of the core API and therefore we don't introduce some unwanted dependency to o.p.d to o.p. Regarding security it depends on the question, if a Parameter might be tweaked ... but again, I see no real issue with it. Parameter is a read-only interface and a ComponentAdapter is not available from within the components.

So I have no real argument for rejecting this proposal. Did I miss anything?

- Jörg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.