-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Rickard Öberg
Sent: den 17 november 2009 13:27
To: [email protected]
Subject: Re: [qi4j-dev] DCI vs. Qi4i

On 2009-11-17 19.57, Pawel Niemiec wrote:
> I've been interested in Qi4j after I've seen the DCI panel on the Oredev
> conference.
>
> I'm trying to figure out how could I use mixins as roles. I found an
> article that describes it, but the is only bit of code example available.

I'm planning an article with the same example as the one I used in my 
presentation, so that might be helpful. But it's gonna take awhile to 
get it written and published.

That would be very useful.

> I'm particularly interested in a case when two or more of mixins'
> interfaces have a method of a same name.

Same name is ok, same signature is not. You have to make sure that two 
methods in different roles don't clash, signature-wise (name+parameter 
types).

> Is it possible to get an instance of each mixin as a Human Composite ?

That question does not compute. What exactly do you want to accomplish?


Assume I have two mixins with the same method's signature. Assume that my human 
wants to speak().

I could do in particular do so:
HumanComposite humanDeveloper = (HumanComposite)new DeveloperMixin();
Or
HumanComposite humanDeveloper = (HumanComposite)new AlumniMixin();

That's usual polymorphic declaration.
I was wondering if there were possible to achieve let's say "horizontal" 
polymorphism with a help of factories that are provided by Qi4j or other Qi4j 
mechanism that I don't know, but as you say it's impossible to have same 
signatures' names of methods in a same composite. 

Thanks for your fast reply.

/Pawel

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to