tags:

views:

28

answers:

2

I have a server application that spins up and monitors about 8 separate processes that gather data from different systems. The server app then runs some calculations over the aggregated data and stores it in a db. Simple stuff.

I now have a requirement to modify the process so that it no longer saves data to the db but rather exposes it directly to clients via WCF.

That's cool, I've used WCF a fair bit but I'm struggling a little with it for some reason.

Basically my plan is to HOST the WCF service in my application and have calls redirect into the internals of my existing application but I can figure out how to do that without getting the WCF class to encapsulate the existing app.

I want the service to inside my current app, not become it.

Any suggestions?

+1  A: 

I suggest you don't change what ain't broke.

Continue storing the data into the database.

Then expose the data from the database via a WCF service.

John Saunders
Unfortunately it's a little more complicated than that. The service is going to allow people to enter additional information which then feeds into the calculations and the results need to be real time, no db write down delay.
Steven
@Steven: please update your original question with this information. It makes a big difference.
John Saunders
A: 

MyService service =new MyService();
service.EventA += EventHandeler();
new ServiceHost(service).Open();

WCF allows you to pass in an instance to the service host!

Steven