Archives

Archives / 2011 / August
  • T4 Metadata and Data Annotations Template

    Awhile back I was working on an ASP.NET MVC 3 project that required a lot of “standard” validation to be performed (required fields, validate lengths, some regular expression validation here and there, data type checks, etc.). Due to the number of classes involved I decided to go with the data annotations approach to keep things nice and tidy (some people love this, some people hate it – such is life :-)). As I dug more into the project I realized it was a fairly monumental task to create a metadata class for each of my model classes so I ended up investing one night to create a Visual Studio T4 template that could generate all of the metadata classes automatically based on an Entity Framework 4 model. I published the project up on CodePlex to make it easy for other devs to get to but realized I never blogged about it. Here’s an overview of what the T4 metadata and data annotations template does.

  • Building the Account at a Glance HTML5/jQuery Application

    As Web technologies continue to evolve developers are required to learn new technologies in order to build successful web-based applications that stand above the crowd. This can be a challenging proposition especially for developers moving from desktop or Rich Internet Application (RIA) development frameworks. To help developers learn the latest HTML5, CSS3 and JavaScript technologies, we built a sample application for demonstration at Microsoft’s MIX 11 conference called “Account at a Glance” (download the app below) which we’re now able to (finally) release. The application takes advantage of key web technologies and uses them to display brokerage account information to consumers.

  • Revealing Prototype Pattern - Techniques, Strategies and Patterns for Structuring JavaScript Code

    imageThis is the 4th post in a series on techniques, strategies and patterns for writing JavaScript code. In my previous post I discussed the Revealing Module Pattern – one of my favorite JavaScript patterns. If you like the features offered by the Revealing Module Pattern but want to take advantage of JavaScript’s prototype functionality and the benefits it offers, the Revealing Prototype Pattern may be what you need. It offers the benefits of the Revealing Module Pattern but also provides a way to share function implementations across object instances through prototyping. The pattern is a combination of the Prototype Pattern and Revealing Module Pattern.

  • Revealing Module Pattern - Techniques, Strategies and Patterns for Structuring JavaScript Code

    This is the 3rd post in a series on techniques, strategies and patterns for writing JavaScript code.The Prototype Pattern shown in an earlier post works well and is quite efficient, but it’s not the only game in town. One of my favorite overall JavaScript patterns is the Revealing Module Pattern since it’s cleaner with less usage of the “this” keyword. I also like the fact that it doesn’t separate code into constructor and prototype sections. Although it doesn’t offer the benefit of sharing functions implementations across objects through JavaScript’s prototype feature, it’s definitely a viable option.

  • The Prototype Pattern - Techniques, Strategies and Patterns for Structuring JavaScript Code

    This is the 2nd post in a series on techniques, strategies and patterns for writing JavaScript code. In my previous post I introduced what I call “function spaghetti code” and explained some of the problems it introduces. I also talked about the impact of global variables and how closures add a much needed solution. In this post I’ll introduce the Prototype Pattern and show how it relies on built-in functionality in the JavaScript language.

comments powered by Disqus