Archive for the ‘Architecture’ Category

iOS Push Notifications in C# with apns-sharp

November 28, 2010

I just recently set up push notification in an iOS application for the first time. The back-end is implemented in C# and searching the web for existing solutions i came across “apns-sharp” ( “apns” is short for Apple Push Notification Service and the library, as you would expect, provides a C# api for sending iOS push notifications. The library also contains an api for Apple’s Feedback service for – a service used to retrieve push tokens that are no longer valid, so as to be able to clean up subscribtions.

Initially i got things working on my dev setup without hardly any effort. I then proceeded to publish the project to by budget webhost and suddenly I wasn’t receiving notifications anymore. It took me quite some time to figure out what was wrong…



User-friendly concurrency handling in occasionally disconnected systems

February 1, 2010

Recently i was in a hurry to grab some reading material and i accidently pulled out a book I’ve mentioned previously. David Platt’s “Why Software Sucks” is full of thoughts on how software could be made more user-friendly. One of his points is that users should not have to understand the internal workings of a computer or the particular piece of software, they are trying to use.

Reading this again made me absolutely sure we had come to the right decision in a recent discussion on how to deal with concurrency in an “occasionally disconnected” client / server system.


Android and permissions: Taking a screenshot

August 21, 2009

I had to do some screenshots for a presentation on the Android project I’m currently working on and to my surprise I found that searching for “Screenshot” on the Android Marketplace turned up zero results actually related to taking a screenshot.

I thought to myself that I would do a “shake to screenshot” app, but quickly realized that it was too good to be true, that nobody had thought of this. So I decided to investigate…


Making Roles Explicit

June 29, 2009

Commenting on my previous post, Udi Dahan brought this talk of his to my attention:

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.

Composite Application Block (CAB) ItemsControl vertical stretch

June 17, 2009

So we just started using the Composite Application Block for a Silverlight project. Greate stuff. But we quickly ran into an issue where we were unable to make a subview stretch to fill out its containing region. Turned out that a template containing a DockPanel needed to be added to the ItemsControl representing the region.

After lots of playing arround, I finally found the solution here:


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.


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): 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