Jan 26, 2012

On Code Architecture (.Net, CSharp, WCF and WPF)

Been working on an "educational" project for on of our clients at work. They are migrating to the .Net Framework and CSharp. As an example project that also is useful I (among other co-workers) implemented a nice and simple server-client architecture for an application they need. I'm pretty satisfied with how it turned out so far. The project is almost finished and I've had a easy time tracing and fixing bugs as well as implementing some last minute changes. The architectural concept seems to work well.

Nice thing about such a project is that you get time to have a closer look at the architecture. To have lots of (sometimes heated) discussions with different people about it and to really widen your understanding of different concepts. Also its a good time to experiment with things and try different approaches to find out what works well for you. Furthermore, I learned a lot about some .Net technologies I didn't use extensively before. In my opinion the time I spent digging deeper into these was well worth it. I'm convinced that other projects will greatly benefit from my new/improved knowledge.

The architecture is pretty straight forward and I hope for most nothing new. I've known it for some time but never really implemented it as its intended. Mostly due to lack of time/control or the simplicity of projects I've been working on in the past. This project was the chance to once do things the right way. The architecture is layered and consists of a data layer, business layer and a presentation layer.


Data Layer
This layer is pretty dump. Minimal Logic which handles connecting to a "datasource". On our Server side this is the SQL Database using Entity Framework. On the Client side this is the WCF Webservice. The idea here is to simply exchange this layer with an other one to connect to a different source.

Business Layer
Almost all application logic is located within this layer. It uses the data layer to access the needed information. On the server side it handles transformation of the database objects into POCOs which later can be easily sent over the WCF Webservice to the client. Also, it does data validation and security checks. As our client doesn't do much logic it mostly does data caching and management on that side.

Presentation Layer
This is where others interact with the Server/Client. On the server this means the WCF Webservice. This consists of an Interface as well as the implementation that mostly routes everything into the business layer. On the client side this is a bit more heavy. We use WPF (XAML, Behaviors, Converters, Commands, Data binding aso.) for the actual UI and make heavy use of the MVVM (Model - View - View Model) pattern.

This whole architecture created quite an initial time overhead (which I underestimated). But I think that over time this will pay off. Finding bugs, fixing and extending code is so much easier with this consisted architecture. This will save some time in the future.

Sidenote: We use integration builds and unit test the server business layer. I think with ~70+ tests and a 81,9% statement coverage we do pretty well there. More unit tests would be nice but this covers the most important logic of the application.

There is room for improvement but overall I'm pretty satisfied with our results ...

Jan 24, 2012

Ubuntu: HUD



Mark Shuttleworth » Blog Archive » Introducing the HUD. Say hello to the future of the menu.

nice, I like that. Especially for menu heavy applications this will be great. Much easier and faster to use ...

Jan 16, 2012

Jupiter Broadcasting: LAS



Linux Rocks CES | Jupiter Broadcasting

Linux Action Show is just the best Linux enduser podcast out there.

PulseAudio vs. AudioFlinger

PulseAudio vs. AudioFlinger: Fight!

I like this one. Good comparison. The Android audio stack has often been criticized for it's inability to handle audio well.

Jan 11, 2012

About Focus & Change (on my webpresence)

I've started to change a few things related to my (and my projects) online presence. But first a bit of background and what's there right now. Years ago I purchased some webspace and domain names. At the time All-Inkl.com has been my service provider of choice. I've had no problems so far and am not planning on switching anytime soon. The problem is that I have to manage the different websites on this space. Updating things isn't very hard but still takes time I rather spend on something more productive. Nowadays there are enough services offered to replace a few things I used to manage "by hand".

For some time I've been running my own wiki page for projects. This has mostly been "private" information about unreleased projects. Last year I already started to use Google Sites for this as they offer everything I need for that. I can keep them private and let others edit the pages wiki style as well. It's simple and straight forward and I don't need to mess around with background technology. I've used this for most of 2011s projects. A few of these will hopefully be released this year. Furthermore, I use these Google Sites as an Idea dump for future projects. It's just simple, has all needed features and I can access it from everywhere without the need to remember separate credentials. It's just very convenient this way.

Also, I've had a personal webpage for a long time now (started in 1996). This page has always been about my projects. Later it started to become a little more about my person by adding a CV as well as a blog to it. The current iteration runs on Drupal 7 which I'm pleased with. But I still want to remove the burden of keeping it's software and modules up-to-date. In 2011 I've already struggled a lot with that (on most of my sites). I already moved my blog off the site in 2009 (and I'm glad you could find my current blog ;). Blogger has been good enough for me and I especially enjoy the good Google integration. So back then Blogger has been a natural choice. I'm planning to migrate the rest of my site to Google Sites in the coming weeks. Mainly this is the (short) information about my projects as well as my up-to-date CV. I'll keep my old site running for some time but will not update it anymore.

This will hopefully free up some of my time for these low-changing sites. I plan to keep GameDev.at as well as the digitalDreams page on my webhost for now. Hopefully I'm able to get them up-to-date soon. Especially I'm sad that GameDev.at doesn't work anymore. That one will take some time to fix.

More on Google Sites in an other post soon ...

Jan 9, 2012

Ubuntu TV for human beings



Ubuntu TV will be an interesting thing to watch. Right platform to start with. Looking forward on how this will turn out at the end of 2012. Maybe we'll really see some first devices with this appear. I hope Ubuntu 12.10 will include some of this work. Would be nice to have an integrated media center in Unity.

Some more on: I Want My Ubuntu TV! (TechCrunch)

Jan 8, 2012

Center & LFE Channel silent?

Here is a quick fix that worked fine for me on Ubuntu 11.10:

short version:
Just put your volume to the minimum and to the maximum value (might need to let some sound play). Did the trick for me.

longer version:
It seems that something messed up my audio channel levels. In my case the center and LFE (your bass > subwoofer) channel where set to 0 in Alsa. Pulseaudio didn't increase them as I increased the volume. This resulted in having no bass and one channel less while playing normal music (annoying). Also while watching Movies (Surround Sound ones) I couldn't hear what they where saying as that is played mainly over the center channel. So movie music and effects where normal but the characters voices all very dimmed down. Understandably this makes most movies unwatchable.

I did search for this but couldn't find anything recent. I opened up alsamixer on the terminal and saw the channel problem. The solution then was pretty simple. Put the volume to min and max and Pulseaudio and Alsa are synced again. "To max" not on your keyboard as that doesn't go all the way to 11 ;). Open up the sound settings and change it there. You might need to play some sound for this to work. Just use a music player and decrease the volume there as pulse has individual volumes for each app. So you don't annoy your neighbor with too loud music. After that it hopefully should be back to normal again.

I suspect that some of the great Humble Indie Bundle Games did mess with my sound as I was playing them a lot lately :).