Hi Kurt, 

Indeed the constructor calls a method on IMyService which creates the loop. 

Best Regards, 

jean safar
European Technology Director                    
        Work: +33172745536
Mobile: +33611507664
Fax: +33172745537
                Email: [EMAIL PROTECTED]
IM: safarje (Skype/Yahoo)
 Professional Profile
                Quartet Financial Systems
52 Bd Sebastopol
Paris France
                
        Want a signature like this?     

-----Original Message-----
From: Knut Wannheden [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 04, 2005 10:10 AM
To: [email protected]
Subject: Re: Infinite Recusion Issue When Creating a Service

Jean,

On 11/3/05, Jean Safar <[EMAIL PROTECTED]> wrote:
>
> I am experiencing a problem by which HiveMind (version 1.1 and 1.1-beta-3)
will enter into a infinite recursion when creating a service. This
eventually exhausts all the available memory and makes the program unusable.
>
>
> I have a Service Class MyService implementing the interface IMyService.
>
> This class has a constructor public MyService (IMyService) {...} as well
as other constructors.
>

If the constructor implementation doesn't call any methods on the
IMyService parameter and the service's model isn't primitive (which it
isn't in your case), then I reckon this kind of "self injection"
should be fine. If however the constructor implementation calls a
method on the IMyService parameter, then I can see how a loop like
this could be entered.

Can you confirm that your constructor implementation calls a method on
the IMyService parameter?

Thus a better solution than forbidding this style of "self injection"
would be to make the BuilderFactory detect such loops. This should
then also cover cases with more services involved.

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to