Nodejs application architecture: Battlefield 3 Web Commander

Tags:

In this post I’ll talk a bit about the architecture of my first nodejs application, Battlefield 3 Web Commander. In addition to your usual web app stuff, Web Commander talks to Battlefield 3 game servers in real time and has many features related to that. It also displays data from the servers in real time. Because of these, there is …

Creating custom dojox.dtl filters

Tags:

Dojo’s implementation of the Django Template Language (DTL) is pretty convenient for client-side templating in Dojo applications. However, sometimes you need to customize formatting of values, or add other custom logic to it. Using a filter for this purpose is quite convenient, but Dojo’s implementation is completely undocumented as to how you would add your own. Turns out it’s actually …

Why does everything need to be integrated into a framework?

Tags:

There is occasionally people asking about things such as “Is there an integration for X in framework Y” Then they are disappointed when it isn’t, acting as if it’s a really bad thing. But why do things need to be integrated to begin with?

Thoughts on CoffeeScript

Tags:

I initially dismissed CoffeeScript as just another silly attempt at making JavaScript not be JavaScript. It probably also compiled the code into some sort of totally wonky JavaScript, too. However, after thinking about it for a while, I decided to actually try CoffeeScript and see for myself. Now, after using it quite extensively on some projects, I feel I’m qualified …

Adventures in Haskell: Dynamic loading and compiling of modules

Tags:

In my latest attempt at using Haskell, I was working on creating a kind of a plugin architecture for my application. I wanted to be able to load haskell code dynamically, without having to restart the main application. This is doable using the GHC compiler API’s. However, the documentation for it is quite lacking in examples, and while I was …

Doctrine 2 and the law of demeter

Tags:

Doctrine 2 makes it very convenient to access related objects in your code: Just do a $entity->getRelatedSomething()->getThingValue(); However, this kind of pattern makes for easy errors when getRelatedSomething returns null – and as a side effect of this, you can end up with a lot of code which checks if the value exists before accessing it. This in turn can …

How to automatically run unit tests from a git push

Tags:

Typically when working on code that has tests, you would want to make sure your tests pass when you share your code with other people. It’s generally a good idea to run the tests once in a while too, but why do it manually when you can automate? In this post I’ll show a simple shell script you can use …