Website Consistency

Domains of Consistency Since I began developing web sites in ’96, this must be one of the most under-valued, overlooked, and most expensive concept to ignore. I once read statistics regarding the amount of time planning a web site up front as opposed to “figuring it out” as the project dragged on, they were quite…

Visual Studio: Incremental Search

Making Search Easier to Use. Visual Studio’s “Quick Find/Replace” (F/R) is a common staple for many web developers seeking to make batch replacements of strings within their code. However, one often overlooked feature within the IDE is “Incremental Search” (IR). This handy utility provides find capabilities similar to that of many “web developer” toolbars provided…

C# 4.0 Parameterless Functions

Please see my other C# articles. Integrating flexibility into class behavior. When designing class behavior, knowing ahead of time how that function will need to be used is sometimes difficult. For example, when defining the function signature how do you know in what order the parameters should be arranged and what if that makes a difference to…

TDD: Testing with Stub Methods

Please see my other Test Driven Development articles. Adding flexibility to return values using Stub methods. Continuing on my “Testing with Dummy objects” article, you might have noticed a limitation with regards to the return value – only one was allowed. In situations where multiple return values are needed, Stub methods provide an alternative. In…

TDD: Refactoring with Polymorphism

Please see my other Test Driven Development articles. Using polymorphism to refactor SRP violations. Single Responsibility Principle (SRP) violations are one of the most common issues found in code. Either the class or its behavior is attempting to fulfill more than one primary purpose. In this example, I will illustrate how polymorphism provides a powerful…

TDD: Mocking with Dummy Objects

Please see my other Test Driven Development articles. Using custom objects in place of a mocking framework. When it’s desired to avoid the overhead of a mocking framework and its functionality isn’t required, developers may elect to provide their own dummy objects instead. In this article I will illustrate a simple example of writing my…

TDD: Assets

Please see my other Test Driven Development articles. Leveraging overloaded Assert() methods to enhance test methods. Continuing from my TDD: Mocking with Dummy objects article, I wanted to illustrate some examples of other Assert() methods available for use to enhance testing results. As illustrated in my last example, you may just utilize the traditional Assert.AreEqual()…

MVC: Validation – Remote

Please see my other MVC articles. Using the Remote attribute to leverage JQuery’s validator. MVC provides a flexible and powerful method for using logic external to the Model for enforcing business rules – the Remote attribute. In this article, I will illustrate how to use an action method from a Controller to validate a Model’s…

MVC: Validation – Model

Please see my other MVC articles. Enforcing Model-level validation. MVC enables validation to be performed at the model-level by implementing the IValidatableObject interface. Once you’ve defined Validate(), your routines then may perform custom validation using the Model’s properties. To illustrate this feature, I’ll implement a routine to ensure the territory entered is one of the…

MVC: Validation

Please see my other MVC articles. Utilizing validation in the model to enforce business rules. In this article, I will illustrate some of the basic validation types available to ensure business rules for data are enforced. Since MVC provides this capability within the Model, separation of concerns are maintained by keeping this logic out of…