{#advanced_dlg.about_title}

Programming »

Saturday, December 7, 2013 | 0 Comments

I am reading the book Metaprogramming in .Net which gives a solid introduction about metaprogramming and the various techniques and tools you can use when doing metaprogramming in .Net. One of the described techniques is the CodeDOM. The CodeDOM is nothing new and has been there since the beginning of .Net. With the CodeDOM you can build object graphs which you can use to express code as data. The newer Expression Trees introduced in version 3.0 of .Net are something similar but work differently and don’t provide the same features. Meaning expression trees won’t replace the CodeDOM. An object graph can be converted to source code or even be compiled into an assembly. This creates powerful scenario’s like building code gene... [More]

{#advanced_dlg.about_title}

Programming, Technology »

Friday, November 18, 2011 | 3 Comments

Portable Areas are a powerful feature of MvcContrib and provide a solution to distribute MVC areas as assemblies. Which is handy for a lot of things. This post is not about that, but a tiny bug we found this week at work. At our client we still use version 2.0.96.0 of MvcContrib but it appears to be still a problem in the latest version 3.0.51.0. When working with masterpages most of the time you will want to use the master of the host to be used as the master of all embedded views. I will not go into detail on how to accomplish this (see examples on the web). The code performing the mapping of the views with the master pages results in a exception when using curly braces inside your view (i.e. for loop). If you do you will get a FormatExcep... [More]

{#advanced_dlg.about_title}

Programming, Technology »

Sunday, October 9, 2011 | 2 Comments

Last week I have been breaking my head on how to effectively apply the repository pattern? There are a lot of different implementations on the web each with different pros and cons. In the most well-known definition it should encapsulate the business entities from the underlying data infrastructure. Most of the time it sits on top of a data mapping layer which is responsible for mapping your tables to the right classes, usually called entities. I came across implementations that support CRUD or are just read-only, some are generic, some use a query object pattern, some use the specification pattern, some use LINQ expressions, some support unit of work, some expose the IQueryable<T> interface and some encapsulate advanced queries... [More]

{#advanced_dlg.about_title}

Programming, Technology »

Sunday, June 5, 2011 | 0 Comments

Without reflection the world would be nowhere, we would know nothing about ourselves and the people living next to us. The same is true for software development. Of course this is exaggerated but it’s a little bit true. A lot of things would be needlessly complex, take to long or just not possible. I use it a lot when I have to implement dynamic behavior in my code. For example when you have to call a generic method but the type parameter is only known at runtime, reflection is the man for the job. Of course there are downsides. When you are obtaining meta data on properties, fields and methods you will have to use strings to refer to them. This is not ideal because you will have to keep them up-to-date whenever you rename a property,... [More]