Question

I am looking to expose my existing .NET libraries to an intranet.

With many moving to RESTful services, OpenRasta looks tempting. In a similar vein, I am playing around with Sinatra in IronRuby.

I am primarily looking for 3 points:
1) What are you using to expose your existing codebase to the web?
2) What about your method makes it easy to implement
3) What about your method makes it secure?

Was it helpful?

Solution

I think that if your library was not designed to be exposed to the Internet, then doing so is a bad idea.

Further, if your library doesn't deal with things that make sense as resources in an HTTP sense, then it's not a good idea to expose them with a REST interface.


In response to the comment, "Why?"

I'll assume it's a well-designed library. I assume you had certain requirements in mind when the library was designed; certain use cases and scenarios; you may even have written samples of using the library, just to make sure that it was easy to use. As a result, the library met all of these requirements, and can be called well-designed.

But you don't seem to have included "expose to the Internet" in your requirements, or use cases. You don't seem to have included "expose via a REST interface", either. Chances are that the library that is well-designed to meet one set of requirements will not be well-designed to meet the other two, unless it's by accident.

This is especially the case for the REST aspect. The objects exposed by a library are quite unlikely to meet the HTTP definition of "resource" that REST is based on. Attempting to twist them into the right shape will just be painful.

My recommendation would be to get a new set of requirements together for exposing the functionality of your library as a well-designed set of services. These services would be implemented by calls to your library.

In an ideal world, this process would result in a REST API that is exactly like the one you would have designed in the first place. But it may result in something quite different.

OTHER TIPS

Personally I use WCF to expose my .NET libraries. It supports many different transport protocols and bindings. I am sure you will find the one that fits your needs. It also allows you to implement secure communication.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top