// ThomasWeller

C#/.NET software development, software integrity, life as a freelancer, and all the rest


News

Can’t code without   The best C# coding assistance and
    refactoring plugin for Visual Studio


Delicious   Delicious Toolbox


My Stats

  • Posts - 35
  • Comments - 68
  • Trackbacks - 0

Recent Comments


Recent Posts


Archives


Post Categories


Free e-Books


Toolbox: Development


Toolbox: Documentation


Toolbox: Productivity


Toolbox: Static analysis


Toolbox: Testing


Toolbox: Textual analysis


Architecture and Design

Integrating a LinFu IoC container with your ASP.NET MVC application


This post shows how an application's LinFu Ioc container can be seamlessly integrated with the ASP.NET MVC framework, enabling Dependency injection and the use of interfaces for controller creation and for viewmodels (both in controllers and views)...

posted @ Monday, December 07, 2009 7:25 AM | Feedback (2) | Filed Under [ Architecture and Design ]


Validating business objects with AOP (3: UI with ASP.NET MVC + xVal)


This is the third post of a three-part series that discusses the use of the ValidationAspects aspect library for business object validation and its integration in different application layers. This time the (server-side) validation aspects are "translated" to (client-side) validations of ASP.NET MVC application web pages, using the xVal framework to do the mapping...

posted @ Monday, November 23, 2009 4:47 AM | Feedback (0) | Filed Under [ Architecture and Design ]


Validating business objects with AOP (2: persistence with NHibernate)


Validation is one of the most important objectives when crafting a domain. Domain objects must be sheltered from invalid property and method arguments. Moreover, it is sometimes necessary to explicitly validate an object's state, for example to enforce business rules. This is the second post of a three-part series that discusses the use of the ValidationAspects aspect library in different application layers to do this, this time looking at NHibernate integration...

posted @ Wednesday, November 18, 2009 7:33 AM | Feedback (0) | Filed Under [ Architecture and Design ]


Validating business objects with AOP (1: the domain)


Validation is one of the most important objectives when crafting a domain. Domain objects must be sheltered from invalid property and method argument values. Moreover, it is sometimes necessary to explicitly validate an object's state, for example to enforce business rules. This is the first post of a three-part series that discusses the use of the ValidationAspects aspect library in different application layers to do this...

posted @ Sunday, November 15, 2009 1:57 PM | Feedback (4) | Filed Under [ Architecture and Design ]


Lazy loading, Inheritance, and Persistence ignorance (part 3)


NHibernate uses lazy loading by default, which is generally a good thing. But when applied to polymorphic objects, this can lead to unexpected behaviour and serious problems - the first two parts of this series talked about that. This post - together with its predecessor - demonstrates a technique to make NH create lazy-loading proxies for a concrete subclass instead of for an abstract superclass, thus avoiding some quite nasty, hard-to-debug and hard-to-understand pitfalls...

posted @ Saturday, October 03, 2009 5:57 AM | Feedback (6) | Filed Under [ Architecture and Design ]


Duct Tape Programming? - Certainly not THAT way...


Lately, there was a blog post by Joel Spolsky called "The Duct Tape Programmer", which is very opinionated and caused quite a lot of responses and discussions in the blogosphere. Basically, this post contrasted the duct tape worldview of developing software to the astronaut architect's, forcing programmers to decide between quick-and-dirty solutions on the one side and analysis paralysis on the other. While all objective arguments against that are already made, here are some additional thoughts.

posted @ Wednesday, September 30, 2009 8:25 AM | Feedback (4) | Filed Under [ Architecture and Design ]


Lazy loading, Inheritance, and Persistence ignorance (part 2)


Previously, I described a problem with O/R-mappers like NHibernate that could possibly break domain code which is relying on type information (this is not only relevant for casting issues!). The problem occurs when NH creates a lazy loading proxy for a polymorphic object, not knowing the exact type of the proxy at creation time. This post presents the first part of a possible way to circumvent these problems and to be truly persistent ignorant - not just physically, but also logically...

posted @ Sunday, September 20, 2009 7:28 AM | Feedback (0) | Filed Under [ Architecture and Design ]


AOP can save you tons of repetitive code


Lately I played around a bit with Aspect Oriented Programming, especially with PostSharp and the ValidationAspects library that sits on top of it. I wanted to see how I could reduce the amount of infrastructural code like e.g. value-checking, which is highly repetitive and error-prone. I must say, I was impressed of what can be achieved...

posted @ Tuesday, September 15, 2009 6:41 AM | Feedback (3) | Filed Under [ Architecture and Design ]


Lazy loading, Inheritance, and Persistence ignorance (part 1.5)


A few days ago, I talked about a problem, that using an ORM like NHibernate could bring, when there's inheritance and lazy loading around. Unfortunately, the example in this post turned out to be somewhat unclear, giving the impression that type casting issues are relevant in some way. This is a short follow-up with another example, that hopefully underpins my arguments a bit more precisely.

posted @ Thursday, September 10, 2009 7:53 AM | Feedback (0) | Filed Under [ Architecture and Design ]


Lazy loading, Inheritance, and Persistence ignorance (part 1)


Recently, I came across a problem with NHibernate (and ORMs in general), lazy loading, and polymorphism. Initially I thought it to be just another one of these fancy technical details that one has to deal with all the time. But now I consider it to be a 'real' problem that can question our entire approach to architectural layering.

posted @ Sunday, September 06, 2009 8:07 PM | Feedback (8) | Filed Under [ Architecture and Design ]


The silver bullet of software architecture ?


posted @ Monday, August 24, 2009 12:58 PM | Feedback (0) | Filed Under [ Architecture and Design ]