Programming

Patterns 101 - Factory Pattern

Note: This is part of an ongoing series introducing patterns at the Tampa C# Meetup. Purpose The factory pattern, formally called the** Abstract Factory Pattern**, abstracts the creation of a concrete class.Basics Using this pattern requires 4 things. A base class or interface that the created concrete classes derive from An abstract class or interface base with a method that has a return type signature from #1 One or more concrete classes derived from the type in #1 A number of concrete creation classes derived from the type in #2 with an implementation to the creation method returning a concrete class

Patterns 101 - Observer Pattern

Note: This is part of an ongoing series introducing patterns at the Tampa C# Meetup. Introduction No introduction to patterns is complete without the ubiquitous explanation of why we need patterns. Rather then re-invent this wheel, yet again, I will reference others and refer you to a couple books. In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code.

Using Code Contracts for Safer Code

Note: This was presented to the Tampa C# Meetup on April 20th, 2011. One of the greatest challenges in writing code is that nebulous time when the code is too complex to keep the flow all in your head, and when the debugger gets too much in the way for watching the state of your program as it runs. This is the coding twilight zone in which the quality of the code tends to drop as you add line after line of instrumentation to your code to find that spot where something goes wrong.

Managing Dependencies with NuGet

Note: This was presented to the Tampa C# Meetup on April 6th, 2011. Most large .NET projects will use a number of libraries and frameworks. Those dependencies of your project will have their own dependencies. To make it more complex, those libraries may depend on other libraries, and in some cases – on each other. The Dependency Management Problem The dependency problem is something that strikes fear into the heart of many a developer, and even more in to the lead or manager.

Caliburn.Micro ViewModel File Template for ReSharper

Over the last few weeks I have been writing some in-depth articles for my Learning Caliburn.Micro series. Today is a brief side-discussion where I introduce a ReSharper File Template to help with the task of generating view-models. Background So why do you need this template? Simple – to write those twenty or so lines of code you constantly have to do yourself. I will warn you – this template is highly opinionated.

Bootstrapping Caliburn.Micro with Autofac

It has been about two weeks since my last post in my Learning Caliburn.Micro series, so it far past the time for this post. Prepare the Project This post is going to focus on using the Autofac IoC with Caliburn.Micro. From the point of view of the framework it fulfills the same task as the MEF bootstrapper I discussed in Caliburn.Micro the MEFtacluar, or Rob discussed in Caliburn.Micro Soup to Nuts Pt.

How To Do Logging with Caliburn.Micro

Caliburn.Micro Logging Abstraction This post covers logging. Caliburn.Micro has a simple logging abstraction that consists of an ILog interface, and a LogManager class (see below). To add logging to any Caliburn.Micro project, you need to implement a class that extends the ILog interface, and you need to replace the delegate for GetLog. In this post, I will show you how to hook up a debug logger that logs to the Output window in Visual Studio, a log4net logger, and an NLog logger.

Caliburn.Micro the MEFtacluar

I was going to call this post ‘How I learned to stop worrying and love MEF.‘, but I am not sure enough people would get the reference. Besides, it would put the focus too much on MEF, and not on Caliburn.Micro, which is the topic of the post. This is the second in my series of using Caliburn.Micro for WPF applications. The first post, Caliburn.Micro – Hello World, covered an introduction to setting up a project, and the basics of view and view-model interaction.

Caliburn.Micro – Hello World

In this post we are going to create a simple WPF application using Caliburn.Micro. I have created an empty Visual Studio 2010 solution for all the projects in this blog series. All of the code for this series will be available on my Github Learning Caliburn.Micro repository. But I suggest you follow along, and try and do it yourself. Start Visual Studio, and create a new WPF Application project called HelloWorld.

Introducing Caliburn.Micro – Lightweight MVVM & WPF

I have used a number of different MVVM frameworks, and none has so-far felt right. Not the worlds most scientific criteria, I will grant you, but still one that I consider valid. I have a preference for lighter-weight frameworks. Another vague criteria, but my definition of it is simple – frameworks that do not impose rigid structures and significant bloat to my application by adding features I dont need. Some of the frameworks I have worked with are: Cinch, MEFedMVVM, MVVM Light Toolkit, and Caliburn.