Getting default values from Dictionaries in Swift

Swift is around for some time now and introduced interesting constructions that are not widely used in other languages. One of these construction is if let statement that unwraps optionals. Let's consider following example: let apiDictionary : [String: AnyObject] = ... var name = "Unknown" if let apiName = apiDictionary["name"] as? String { name = userName } Basically our

Understanding Gang of Four's Facade Design Pattern

TL;DR: use Facade Design Pattern to simplify usage of a complex subsystems and reduce number of dependencies your code has During recent Design Patterns training I've attended at Inviqa (delivered by @_md) we had quite emotional discussion about differences between Facade and Adapter patterns (which are intuitively different but it was

PhpSpec Live Templates for PhpStorm

During PhpSpec & PhpStorm webinar recorded together with JetBrains I've mentioned couple of times how Live Templates can speed up your development. Personally on daily basis I'm using templates I've created for PhpSpec and shared after the webinar but since then I've improved those and would like to share it with you

Validating Value Objects

Previous blog post about Value Objects generated quite a lot of questions about validation in context of VO: should be the VO responsible for validating its state? how we should handle this validation? how to interact with users? And in this post I will try to answer these questions and show some