Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
But why would you want to do something as silly as running a Java servlet in an environment that wasn't designed for that purpose? First, many of us die-hard Java fanatics are trapped in Microsoft-only shops due to circumstances beyond our control. We all have our Linux boxes tucked away under our desks, running IBM's latest JDK and Apache's latest servlet engine, but it will be a cold day in the underworld before our bosses let us deploy products on such a system. You can certainly find commercial servlet engines that run on Microsoft's platforms, but they can cost big bucks. Try explaining to your boss that you need a few thousand dollars for a new Web server because you're going to scrap the free one that came with the operating system (or use it as a simple pass-through proxy, which is how many offerings currently work). Then, once your boss stops swearing, you can ask yourself if you're just a little too anxious to abandon the Microsoft ship. Microsoft and Sun have had their problems, but that doesn't change the fact that IIS is a respectable piece of software. And now that you know it can run Java servlets, it has become a little more appealing.
The magic that glues those two technologies together is a simple application of the Adapter design pattern. Quoting from the
infamous Gang of Four book, Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Resources), the intent of the Adapter pattern is to convert the interface of a class into another interface clients expect. But which
classes must you adapt? The answer is the handful of core classes that a Java Servlet uses to interact with its environment -- specifically, the
Request, Response, and Session objects. As luck would have it, you don't have to adapt the Cookie class -- the translation is handled in-line by the other adapters.
IIS, or more specifically its Active Server Page (ASP) environment, contains a core group of classes that virtually mirror those of the Java Servlet specification. Actually, I should say the servlets mirror the ASP framework, since IIS shipped long before the servlet specifications were written, but I won't add any more fuel to the Microsoft-versus-Sun fire.
The Request, Response, Session, and Cookie objects exist in both frameworks. The only problem is that the interfaces for those objects are incompatible between environments.
That's where the Adapter design pattern comes into play. You have to adapt (or wrap) the IIS versions of the objects to make
them look and act like servlet versions.