November 2009 Entries
The other day we had a discussion related to the abstract factory and let me tell you, flames flew and it was high on melodrama. Anyways coming back to the main point, the root of whole discussion was, A: Why should I use the abstract factory, just for a parallel set of classes, what am I getting out of it ? B: You are abstracting your product, that's why you are creating it. Apart from that, its a you have a mechanism for creating related set of products, which is important here, you see you should...
Since I have already mentioned Factory in a post, its time we should talk about the same. Factory should get the respect it deserves because its worth it. Intent Defines an interface for creating an object, but lets subclasses decide which of those to instantiate. Scenario Say we need to implement a way to create Accounts. Now, there are different kinds of Account, a.) Savings Account - Acts as a Normal, but allows you to withdraw only when you are not taking the balance below the minimum stipulated...
Intent Provide interface for creating families of related or dependent classes without specifying there concrete classes. Scenario: I have been wondering about a valid scenario where I would put the Abstract Factory Into play. To be honest it took me some time to really find a valid scenario where I should use it. The catch is "creating families of related or dependent classes", and where would one need this. Where is it being used. We are currently working on development of a framework. Initially...
Have been reading about WCF lately. And to my understanding it’s a very extensible framework. I have had the opportunity to attend quite a few training on WCF as well as to read through some great documentation about WCF. Intrigued by the same, I thought of giving it a try myself. Let me just briefly give you a pictorial representation of the same as best I could comprehend. Hope the above diagram is self explanatory. Unless it is not let me just try and make things a bit clearer. Rather than going...
Lets today talk about the ABC's of WCF. Before we look deeper into WCF, these parts are essential to very concept of any communication framework. Essentially its just a way to get to a resource outside. How do you best describe a reachable resource. If you try and find a analogy, let's say, you are staying in Roswell, GA. You are a good developer. And you are currently working on some task, that requires a deep knowledge of MAPI. And the only book, who has a treatment of the subject that you are...
BACKGROUND Recently, I have been working on Windows Workflow Foundation. We are trying to create a custom host for workflow, and this workflow host is supposed to have a facility, such that it shold be able to provide a way to resume from the exact point where a workflow failed from the Admin UI. Something similar to the Biztalk HAT. Well, having said that the question how can something like this can be achieved ? What I am going to present here is one of the ways of achieving it. There would be...
You remember the previous post on dynamic. We will today look into it in a bit more detail. Yeah, let's ILDASM it and try and identify what is going on under the hood. But for the context of the post let's look at a simpler tale. namespace Coderslog.Net4.Samples { public class SimpleDynamic { public void CallDoSomething() { var instance = GetDoSomething(); instance.DoSometing(); } private dynamic GetDoSomething() { return new BehaviourA(); } } } A very basic class, hmmm which roughly translates to...
Lets examine the dynamic key word introduced in .Net 4.0. It can keep an instance of any type. Then what is the difference between it and System.Object. Well the essential difference between them is the dynamic method dispatching which enables lazy binding, i.e. it allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the normal static binding of C# and instead gets resolved dynamically. It provides a unified approach to selecting...
I thought twice before actually posting this. It was mostly because, of a guilt, that I might be recommending a wrong way of doing things. But then I did realize, that, even if it seems to wrong, it does provide some benefits. Anything that is beneficial, is not necessarily wrong. The problem at hand is, we want to enable ASMX style Authentication in WCF. Its not that WCF does not do a good job when it comes to Security, but because people are more inclined to send the credentials in clear text....