March 2007 Blog Posts

Extending the Web Client Software Factory

I dislike public fields. There's this whole debate on Properties vs. fields which I recently got caught up in while having a look at the ObjectBuilder which is the foundation for the Web Client Software Factory (download the WCSF here). What happened was that I found out that the way to get and store stuff to Session in your Webb Application is to declare a public field of this special generic type and the ObjectBuilder would inject data from session for you! This is what it looks like: public StateValue<User> user; This code would store a 'User' in session. All in all it's a...

SOA Design Patterns and Anti Patterns seminar scheduled

I'll be speaking at the Developer Summit (link to a Swedish site) event in Stockholm again! Last year I gave a talk on Web 2.0: Hype or useful concept? The organizers thought it wize to re invite me this year and also to put me in the Architecture track. I humbly bow and thank you guys for the opportunity! The talk I'll give is in the all familiar subject of SOA Design Patterns and Anti Patterns (link to a Swedish site). It may be that the topic is not a very innovative one for a seminar but somehow I feel that you do not...

Properties vs. fields (yes me too)

Reading a few posts on the whole Properties vs. fields issue: Properties vs public fields redux..., Public fields and properties are not compatible and properties vs. fields... again (thanks for the links Jimmy) I realize that the way I look at it is not really addressed. I like having the intent of my code play out in the interfaces. Some people dislike interfaces, some disgust them. I'll leave that uncommented. I feel that conveying my project's architecture and connections using interfaces is a good way to make visible the overall structure. To me fields are largely invisible and should not be public. Is it good...

I am going to Mix 07!

Going to visit Mix 07 along with three of my colleagues! It's gonna be GREAT! (What was this post about? Honest I just wanted to make you green with envy!) Here's a little story on the Vegas subject: In 05 Dotway went 14 strong to PDC. After the event my girlfriend at the time came over for two weeks of holiday! We had a great time and drove around: Los Angeles, San Diego, Rosarito (Mexico), Palm Springs, Lake Havasu City, Grand Canyon, Las Vegas at the Little White Wedding Chapel! It was SUPER! And while in Vegas... we got hitched! Married in Vegas...

VSTS Test Project -> NUnit test class library

Here's a good explanation on how to convert Nunit Test Project to VSTS Test Project. Are you not running Team System? Guess a lot of the sample code and reference implementation test projects are unavailable to you? Quite often Microsoft supply both a Microsoft Test project and a NUnit class library test project. But when they don't and you still want to look at the tests here's the exact opposite to the initial link: How to convert a VSTS Test Project into a NUnit Class Library: 1. Open the *.*proj file using Notepad equivalent and add remove the following to the element: <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> Now you...

The other way to activate an object instance

While poking around the ObjectBuilder from Patterns & Practices I found something funny. Never thought about this but there are (at least) two ways to instantiate an object using reflection. The first one is the usual one which I'm sure most know about using the System Activator class: Activator.CreateInstance has many overloads so you can create anything in many different ways. The other way strikes me as funny and feels also a little uncomfortable. It's got to do with serialization - or rather deserialization in this case. Suppose you have an object instances' data serialized and want to bring it back to life -...

Customizing the Logging Application Block

I've written two custom configuration elements for the Logging application block. Each has a different purpose and both, I feel, are Worth mentioning. The first custom thingie is a custom trace listener which I named ProcessTraceListener. The reason for the name is that it is a listener which runs inside my process and gives me the ability to easily test my logging code with unit tests. Actually the listener is a helper type in my unit test assembly and not part of my application code. It listens to the log trace and keeps it in memory. Thus i can write tests...