Using the dynamic Keyword in C# to Improve Object Orientation – A Follow-up

Based on some feedback, some clarification is warranted with regard to my previous post titled “Using the dynamic Keyword in C# to Improve Object Orientation”. As Jarek Kowalski correctly pointed out, the example code that I provided could have used the Visitor pattern instead to get the same result.  My impetus for using the dynamic keyword the way I did was slightly different from how I described my example—which was meant to be easier to read. I think it’s worthwhile describing the Visitor Pattern.  The Visitor pattern is a pattern used to separate the responsibility of an algorithm from the … Continue reading Using the dynamic Keyword in C# to Improve Object Orientation – A Follow-up

Using the dynamic Keyword in C# to Improve Object-Orientation

With polymorphism, object-oriented languages allow “…different data types to be handled using a uniform interface”.  Ad-hoc polymorphism is when you declare multiple methods of the same name but differ by the type of an argument.  For example: private static void Draw(Circle circle) { //… } private static void Draw(Square square) { //… } These are usually referred to as method overloads or method overloading.  Which Draw method that gets invoked would be decided upon at compile-time based on the type of the parameter passed to it. This is great, there are many situations where this is useful; but what about … Continue reading Using the dynamic Keyword in C# to Improve Object-Orientation

.NET 4.0, Evolving .NET Development

.NET 4.0 is the first release of .NET since 2.0 that evolves .NET for every programmer.  .NET 3.0 was largely LINQ and .NET 3.5 was largely new namespaces (like WCF, WWF, etc.) .NET 4.0 evolves the programming and design for any programmer.  It offers framework support for parallel processing (PFX will be released), Code Contracts (now DbC is a reality at the framework level, and opens the possibility of it being a reality at the language level post 2010), variance changes (co- and contra-variance on generics interfaces and delegates is now a reality). Parallel Processing Moore’s law has changed from … Continue reading .NET 4.0, Evolving .NET Development