sveerap
sveerap

Reputation: 851

Hosting service oriented architecture

In an interview,a questions is asked on soa. Please see below.

I need to develop an application which should be hosted as windows service, web service, desktop application or web as required by the client. How do you the design and the approach

I said , in a way WCF tries to achieve the same. But he asked what if WCF is not there. I would try to expose service layer on top of business logic ,so that it can be consumed by any. I knew this is not satisfactory.

Or Do I need to use any hosting api's to be able to do that. But can they be configurable without changing any code.

Please share your views?

Upvotes: 2

Views: 1365

Answers (3)

Sanjeevakumar Hiremath
Sanjeevakumar Hiremath

Reputation: 11263

I would still stick with your answer especially if I'm in an interview, in following way. It depends how interviewer drives the conversation, but following thought process would work, I guess.

Lets say WCF is not there, then I have to build a mini-WCF myself which solves the problem, how? What does WCF provide?

  1. It provides a bunch of factories for Channels, hosting, Authentication, etc. Meaning WCF is a Domain Specific Language to write services.
  2. It provides certain level of isolation between code (your code) and plumbing required to make authentication, logging, serialization.

Therefore for a given business domain if I build above set of services (might not be as robust, reliable, or configurable as WCF) but solves the business problem, I could potentially make your code hosted in all possible hosting environments. For each environment I probably have to implement few basic plumbing like activation, channel enablement, with that I can support any future hosting scenarios as well.

With or without WCF the cost difference is not going to be significant if the hosting problems and kind of protocols I'm supporting are limited. Because the cost of writing a service business logic, data access, application interfaces is same, just that plumbing is taken away.

On a second thought, I could ask interviewer is remoting available? if so many of the WCF plumbing is already available there.

Again to back track, lets say if we dont have any of the current technology stacks, then it justifies the cost of investing in a custom stack for the company as it has an opportunity to create such a robust platform, and create standards in the white space.

I'm not sure what interviewer was trying to get at, I've asked similar questions to see if the guy can push the technology envelop by building a business case, without really bogging down by limitations.

Upvotes: 1

Justin Skiles
Justin Skiles

Reputation: 9523

Presentation -> Service -> Business -> Data Access -> Data

The Service allows for Business, Data Access, and Data to be configured regardless of how the Presentation is built.

Upvotes: 0

Jay
Jay

Reputation: 14481

Some of these technologies are completely unlike the others. You cannot write something which is both a good windows service and a GUI application. Windows services by definition do not have a GUI. You need to explain to the client they are wasting their money trying to make something which is everything at the same time.

To give you a concrete example: The same car cannot be both a good snow plow and a good race car. You can make something that is both but it will either be poor at both jobs or very very expensive.

Upvotes: 0

Related Questions