hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Wannheden <>
Subject Re: Infinite Recusion Issue When Creating a Service
Date Fri, 04 Nov 2005 09:09:56 GMT

On 11/3/05, Jean Safar <> 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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message