Strategy Pattern lets you create a family of strategies (algorithm) encapsulated into separate interchangeable classes. In our example, we will consider a Client class which needs to invoke different sorting algorithm. Let's first create the contract interface for different Sorting algorithm. Now that we have our interface ready, let's go ahead and implement different … Continue reading Design Patterns : Strategy Pattern
In the previous part of this series, we looked into some of the basics of using Caliburn Micro. In this part, we will continue with few more examples, how to invoke a method on an event. But before we do that, let's expand our application a bit. Currently the application has two Text controls , … Continue reading Caliburn Micro #02 : BindableCollection & Events
It has been long since i blogged, having caught up with the Product Release and Year End Vaccations. As the calender turns, it would be a good time to learn something new. If you are building an WPF application and is looking out for MVVM Frameworks, you would be surprised with the amount of choices … Continue reading Caliburn Micro #01 : Introduction
Continuing with our series of subtle changes that make differences, let's look into Conditional Attributes over Directives. What would be the output of above code under a) Debug Mode b) Release Mode The Debug Mode should be easy and as expected Hello Method01 Hello Method02 One 2 All Done What about release mode ? 3 … Continue reading Back to Basics #002
Welcome to first post on 'Back to basics'. Yeah, as you guessed right, this series attempt to check minor differences in our understanding of basic concepts. Predict the output of following. Ideally, One would expect the first attempt to fail, but would feel the second would succeed considering we have implemented implicit conversion. But unfortunately, … Continue reading Back to Basics #001
There is already a large amount of literature on the Internet which discusses Adapter Pattern. However, the purpose of article is to showcase the implementations of the Adapter Pattern, rather than discussing the application of the pattern. In this post, adapter class is implemented using 1. Inheritance 2. Dependency Injection 3. Generics Consider your old … Continue reading Design Patterns : Adapter Pattern
Don't ask me why one cannot Serialize/Deserialize a NameValueCollection, but the workaround for the same is based on conversion to dictionary. I ended up writing extension methods to NameValueCollection for serializing and deserializing the collection.