I've got a bunch of services for which I want to keep the options open
and be able to run them both in-proc and out-of-proc just by changing
a config file.

Imagine a ICustomerSearch service that depends on ICustomerRepository,
just an example. Both services are hosted in IIS using the wcf
integration facility.
The configuration for the would look like this:

    <component id="customerService"
                                   service="ICustomerService"
                                   type="DefaultCustomerService"
           lifestyle="transient">
    </component>

    <component id="customerRepository"
          service="ICustomerRepository"
          type="CustomerRepository"
          lifestyle="transient">
    </component>

The svc for customer service:
<%@ ServiceHost Language="C#" Service="customerService"
Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory,
Castle.Facilities.WcfIntegration"  %>

In order to run the repository as a wcf service as well I just need to
create a new host for it and adjust the configuration.
Is it possible to run the repository as both a service and a regular
component in the same time? In other words how can I make the
customerService use the repository but through wcf?
Would something like this work?

<component id="customerService"
                                   service="ICustomerService"
                                   type="DefaultCustomerService"
                                   lifestyle="transient">
    <parameters>
            <customerRepository>${customerRepositoryRemote}</
customerRepository>
    </parameters>
</component>

    <component id="customerRepositoryRemote"
          service="ICustomerRepository"
          type="CustomerRepository"
          wcfEndpointConfiguration="repositoryServiceEndPoint"
          lifestyle="transient">
    </component>

    <component id="customerRepository"
          service="ICustomerRepository"
          type="CustomerRepository"
          lifestyle="transient">
    </component>

I hope I make sense, I am new to castle.


-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.


Reply via email to