BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in WSCF/WCF

 
 
Page 4003 of 20224

Smells like a domain-specific language for using WCF

Blogger : BizTalk Blogs
All posts : All posts by BizTalk Blogs
Category : WSCF/WCF
Blogged date : 2008 May 19


No, not these kinds of domain-specific languages (DSL)...
I must admit, the following code has a not too small degree of sexiness. The DSL-iness is not just for WCF but for a number of mainly dependency-injection-related scenarios, but obviously I tend to care more about WCF :)

Service side:

var windsorContainer = new WindsorContainer()
  .AddFacility<WcfFacility>()
  .Register(
    Component.For<LoggingInterceptor>(),
    Component.For<IMyContract>().ImplementedBy<MyService>()
      .ActAs(new DefaultServiceModel().AddEndpoints(
        WcfEndpoint
          .BoundTo(new NetTcpBinding())
          .At("net.tcp://localhost/MyService/internal")
          )
      )
  );


Consumer side:

var windsorContainer = new WindsorContainer()
  .AddFacility<WcfFacility>()
  .Register(WcfClient.ForChannels(
    new DefaultClientModel()
    {
      Endpoint = WcfEndpoint.ForContract<IMyContract>()
        .BoundTo(new NetTcpBinding())
        .At("net.tcp://localhost/MyService/internal")
    })
   )
  );

                    
I am currently investigating a bit into Windsor Castle and its WCF facility. What I see until now I like, but I am just at the beginning.
There is a lot more in Windsor's WCF support which is worth digging into - all in all these features are aimed to make using WCF a bit more natural and a  bit more straight-forward.

Some feature points from the latest release:

*Client Side:
  • Automatic generation of WCF client channels when a component has been configured for WCF Client capabilities.
  • Any Endpoint or Operation behaviors registered in the kernel will be attached to the channels.
  • Automatic cleanup of channel proxy when component is released (channel.Close() vs channel.Abort), i.e. no need to cast proxy to IChannel and call Dispose.
  • Automatic detection of unhanded channel faults and re-acquisition of new channel proxy. You can continue to use client proxy even after an exception occurs (by default WCF makes all faulted channels unavailable).
  • Ability to use the client channel configuration from app.config/web.config      
  • Custom registration provider to simplify batch registration of channels
  • Client extensibility interface IClientChannelBuilder. Supports plugging in other ways to create channels (e.g. REST-ful services)
 
*Service Side:
  • Automatic management of ServiceHost when a component is configured for WCF Service capabilities.
  • Any Service, Endpoint or Operation behaviors registered in the kernel will be attached to the channels.
  • Ability to use the service channel configuration from app.config/web.config
  • Service extensibility interface IServiceHostBuilder. Support for plugging in other ways to create ServiceHosts.
 More to investigate...



Read comments or post a reply to : Smells like a domain-specific language for using WCF
Page 4003 of 20224

Newest posts
 

    Email TopXML