Archive for the ‘Patterns’ Category

Making Roles Explicit

June 29, 2009

Commenting on my previous post, Udi Dahan brought this talk of his to my attention: http://www.infoq.com/presentations/Making-Roles-Explicit-Udi-Dahan

While I do feel that some of the points I made with regards to persistence are still valid, I did find Udi’s presentation extremely interesting. The example of IValidate<Customer> just feels right. If you have an interest in software architecture, I am sure you will find this interesting.

Advertisements

GenericEventArgs

February 3, 2008

A small and helpful class that I find myself adding to every single project I start these day is ”GenericEventArgs”.

Microsoft included the System.EvenHandler<T> class in .NET, taking away the need to create custom delegates to enable the use of custom event arguments . This class takes it one step further. It’s a simple generic class with the signature EventArgs<T>, deriving from System.EventArgs. It accepts a single instance of T thru the constructor which it exposes via a property “Value” of the type T.

Now where I would earlier create custom eventarg classes to pass a single argument with an event, I simply use this generic implementation.

(more…)

Model View Presenter (MVP) – My first post!

January 27, 2008

Hello all and welcome to Mr. Rask on the web.

For this my first post i have composed a basic introduction to my favorite design pattern: Model View Presenter or MVP for short. The implementation presented in the article is pretty much exactly how i do it at the office office every day.

Model View Presenter is all about seperating user interface logic from graphical implementation. If you have ever build applications using a graphical library like Windows Form, you know how easily user interface code can get cluttered. MVP to the rescue.

Article (.PDF): Model View Presenter (MVP)
Source (C# 3.0 / VS2008): MVPDemo.zip Crappy filehosting died, so if you want it just drop a comment.

Last but not least any feedback is much appreciated. So pretty please – with sugar on top – drop a comment if you find what you read here usefull (or even if you don’t – i just want to hear from you 🙂 )

All the best
Olav Rask