Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

new ServiceHost for every WCF service?

First,Im running a windows service that should contain a lot of funcionality.There will be a business layer and the results comming from this business layer will be sent over WCF to the presentation layer.

I dont know how to structe all this functionality.

So my questions are :

1. Should I create somekind of a Facade pattern class that will cover all the service classes and put this one Facade Class to one ServiceHost. Or just create a ServiceHost instance for every service class?? Like this

host1 = new ServiceHost(typeof(MyService1));
host2 = new ServiceHost(typeof(MyService2));

2.How granular should be my service classes? Per enitity or per aggregate root or per some functionality block ?

This communication will run over net.pipe.

like image 959
user137348 Avatar asked Sep 18 '25 03:09

user137348


1 Answers

There's an example of running multiple service hosts under a single windows service here: http://thegrenade.blogspot.com/2009/08/hosting-multiple-wcf-services-under.html

And a related question here: Can you host multiple WCF processes in a single windows service?

like image 154
grenade Avatar answered Sep 20 '25 17:09

grenade