Hi,

thanks for the answer! 

For my usecase the solution was to use Assisted Injection. I think I got 
something wrong with Assisted Injection when I wrote the original post. Here is 
a link to stackoverflow: http://stackoverflow.com/q/5791423/441467

Dominik

On Apr 26, 2011, at 10:36 AM, opn wrote:

> hey,
> it's a while ago that i read the book:
> Dependency Injection
> http://books.google.de/books?id=b6O6OgAACAAJ&dq=dependency+injection&hl=de&ei=rYK2Tc_TCceSswbqrPTYDQ&sa=X&oi=book_result&ct=result&resnum=1&ved=0CCsQ6AEwAA
> 
> but if i remember correctly this would be a situation for the builder
> pattern. But as i never had such a situation im not too familiar with
> this.
> 
> Regards
> 
> On Apr 25, 12:53 pm, Dominik Obermaier
> <[email protected]> wrote:
>> Hi,
>> 
>> I searched half the day for a solution, but I could not find any. I am not 
>> sure if Guice3 kann do this for me, but I'll explain the problem:
>> 
>> I have a Class which represents a graphical Component. This component 
>> displays data from the database.
>> 
>> Now I have some kind of dashboard, which has 12 of my Components above. Of 
>> course I want to reuse this component! So I thought, I could use a Custom 
>> Annotation with parameters and pass the parameters to a provider. I found 
>> some hack on Stackoverflow 
>> (http://stackoverflow.com/questions/5704918/custom-guice-binding-annot...) 
>> but to be honest, I did not find any documentation how to implement an 
>> AnnotationImpl for my Custom Interface.
>> 
>> I do not think, that AssistedInject is what I need here, because I do not 
>> like the idea to inject 12x the same Class via AssistedInjection to my 
>> constructor.
>> 
>> A No-Go for me is to write an Interface and 12 implementation classes, just 
>> for one different parameter.
>> 
>> Has anyone an idea for my issue?
>> 
>> Dominik
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-guice?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to