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 …