Today, I ended up having a discussion with a friend of mine (Peter Morris) about opensource, Microsoft, and other subjects that are prone to flaming. This discussion, or argument if you will, inspired me to start writing about, and commenting his blogs in the category Diametrical Opinions. This particular category's purpose is to illustrate technological differences and usabilities, as well as proving that the world of computer science is everything but black and white.
Today I will start off with explaining why Microsoft and .NET 3.x is everything but a bad choice when developing software.
To begin with, I'd like to pull out a couple of poltergeist abominations technologies from Microsoft's dust-filled locker:
- COM
- COM+
- DCOM
- MDAC
- OLE DB
- MFC
I guess quite a few of you faithfull readers cringe when I mention these, and I do not blame you. Allthough their intended purpose was good, the implementations of these abominations technologies was cumbersome and completely unscalable. Luckilly, for our mental health's sake, these abominations technologies are derelicts from the past, and should be treated that way (i.e. not used).
Microsoft launched their .NET framework around the year 2000, trying to create a new platform for developers to use, and I fo believe it was to be rid of the above mentioned abominations technologies. The .NET framework has undergone two major releases since then, and the largest and most comprehensive came in 2005 when the .NET Framework 2.0 was released. The .NET Framework has since 2005 undergone one major release (NETFX3) and one majon revision (.NET Framework 3.5). I will deep-dive into that in a moment.
With .NET 3.x, developers were given 4 new building blocks for their software development environments; Workflow Foundation, Windows Communication Foundation, and Windows Presentation Foundation. Windows Cardspaces, unfortunately, is not yet deployed on a full scale, and that is the reason why I haven't mentioned that so far.
Workflow Foundation is a platform for maintaining workflows. I know this might be a very shallow description of the matter, but I need to explain a few concepts first. First of all, I'd like to ask you a rethorical question. Spend some time pondering on it before you continue reading. The question is: What is a workflow? Let's say that you are shopping CDs on Amazon.com. When you start shopping, you basket is initialized and is empty to begin with. Once you find some commodity you want to purchase, you add it to the basket. If you want to purchase more, you repeat the last step untill you want to check out the order. Once the order is checked out, you expect to have the order in your mailbox in a couple of days. What we now have described is a workflow.
A workflow can sit persistent in memory, or it can be unloaded into a database untill it receives stimulus from a process, whereupon it is reloaded from database into memory again. This mechanism is provided to prevent workflow hosts to choke on memory usage while waiting for stimulus from outside events. To do this manually, you would have to design a complete database structure for it, as well as creating approx. 20,000 lines of code just to implement the persistence service. In other words, the workflow foundation reduces your implementation workload by far. I will deep dive further into this matter in a later post.
Windows Communication Foundation (WCF) is an api for creating services. In contradiction to common guidelines by opensource fanatics and gnu zealots, WCF operates by defining a service contract which it exposes to a client. Furthermore, any messages going to and from the service, are defined as datacontracts or messagecontracts, depending on what your immediate need for advanced data structure transfer may be. Even better, WCF is SOAP 1.2 compliant, and is perfectly able to communicate cross platform as long as the endpoint respects SOAP 1.2. WCF also removes the all-too-known limitation of web services by introducing tcp services (non-http network), named pipe services (internal memory), and MSMQ (Microsoft Message Queues) amongst others. This gives WCF an edge compared to other competing technologies, but we are not done yet. As you may know, services and SOA is vulnerable to the biggest pitfall of service communications: the request-response model and blocking calls. Up untill today, the workaround for this issue has been to call a service asynchronously, which in turn is just to make the blocking request-response call in a separate thread, and subscribe to an event that fires once the call is completed. I have to admit that this solves the thread block issue, but, to be honest, that workaround is meerly giving the blocking call to another thread that is not the main thread. You may call it treating symptoms. WCF deals with this problem in another fashion, which is to create duplex services with one-way operation contracts, and creating a callback contract with one-way operations to be implemented at the client that the service in turn calls. This allows for full asynchronosity.
Windows Presentation Foundation is another subject, but I will leave that for later. I guess Peter is already cooking up a reply to this. To next time, I want to challenge you, faithfull reader, to present me with some counter arguments and tell me why I am wrong. I hope you will enjoy this battle of academics and software ideology. There will be more to come. |