itchi
itchi

Reputation: 1713

Where should WCF / WebSerices reside in a Silverlight application?

I'm looking for best practices on where to host associated Webservices/WCF Services for Silverlight applications.

One approach I see quite often is to host these services in the same web application project that is used to host the silverlight application. This seems convenient because it unions the two pieces together.

However, with DRY shouldn't these services be hosted externally so that possibly other applications could make use of them? Should they be in one assembly?

My main concern would be if I had multiple projects on the go, being completed by in house and external contractors. Synchronizing releases seems difficult in this scenario.

Upvotes: 1

Views: 105

Answers (2)

Adrian K
Adrian K

Reputation: 10215

Sounds like you want some kind of interface between them. If you use dependency injection you'd have a solid interface the SilverLight could work aganist and you'd be able to swap-out services providers as often as you like; it'd also go a long way to isolating change.

Upvotes: 0

Ritik Khatwani
Ritik Khatwani

Reputation: 549

I would recommend hosting the WCF service separately. You'd just need to enable cross domain access for your service to allow the silverlight application to access it.

This would also allow you to have two separate release cycles for both of them and it makes for better maintainability if you'll have two separate teams working simultaneously.

Upvotes: 2

Related Questions