hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean Safar" <...@quartetfs.com>
Subject RE: Infinite Recusion Issue When Creating a Service
Date Fri, 04 Nov 2005 09:16:13 GMT
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: jsa@quartetfs.com
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:knut.wannheden@gmail.com] 
Sent: Friday, November 04, 2005 10:10 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: Infinite Recusion Issue When Creating a Service

Jean,

On 11/3/05, Jean Safar <jsa@quartetfs.com> 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: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message