views:

46

answers:

1

I have several WCF services which use castle windsor to resolve their dependencies. Now I need some of these services to talk to each other.

The typical structure is service --> Business Logic --> DAL

The calls to the other services need to occur at Business Logic level.

What is the best approach for implementing this?

Should I simply inject a service proxy into the business logic?

Is this wasteful if for example, only one of two method from my service need to use this proxy?

What if the services need to talk to each other? - Will castle windsor get stuck in a loop trying to resolve each services dependencies?

A: 

If you need to integrate at the business logic level, that means bypassing the service layer completely. In this case, you can just let your service directly consume the appropriate classes from the business model. This would be much less wasteful than making out-of-process calls to other services. In that case Windsor would need to wire up those classes as well, but that ought not be a challenge.

If in-proc services isn't possible due to topological or organizational constraints, one service simply ends up being a client of the other service, so you would need to treat it, and wire it up, just like any other WCF client application.

Mark Seemann