SRV records as service locators

Recently I began work on a project to manage the deployment of a product built using a microservices architecture. As a result of our chosen architecture we have a large number of services which will communicate to each other over HTTP/S. Instead of using fixed IPs we decided to used DNS SRV records to indicate where services could contact their dependencies. Today’s post goes into using SRV records in a little more detail and the problem they solve. ...

May 2, 2015 · MichaelHughes

Loading a Cocos Studio scene into cocos2d-x 3.4/3.5

In the last few weeks I have been slowly learning about the cocos2d-x framework. cocos2d-x is a C++ based cross platform game engine. The makers of the engine also produce a UI creation GUI called Cocos Studio. Today’s post is a brief one about loading scenes from Cocos Studio into a cocos2d-x based application. ...

April 25, 2015 · MichaelHughes

Loops in NodeJS

I’ve written before about how it’s better to write straightforward code than trying to be clever and pre-optimize. Another example of where this rule is true is the cost of iteration between different styles of array loops in JavaScript when executed within NodeJS. ...

March 15, 2015 · MichaelHughes

The importance of being mindful of operator precedence

Operator precedence determines the order [Operator precedence determines the order]2 and binary operators are executed. In many situations, knowing basic mathematical operator precedence (for +,-,*, etc) is enough. In other situations not knowing the specifics of language can lead to hard to find errors. Quickly, in JavaScript what does 'the boogeyman ' + false ? 'is scary' : 'is not scary' evaluate to? ...

January 21, 2015 · MichaelHughes

Using Olingo ODataJS 4 Beta with AngularJS and Web API OData V4

Recently I started writing a new web application which uses OData V4 as the protocol for passing data to back and forth between the JavaScript client and ASP.Net server. The client is written using AngularJS which doesn’t have any built-in facilities for working in OData APIs. In order to avoid writing my own OData message handler I used the Apache Olingo library to handle the grunt work of sending requests and receiving responses. I wanted to encapsulate the Olingo library in an AngularJS service in order to make using it easier, the following post details how this was done. ...

January 5, 2015 · MichaelHughes

Repository pattern overuse: The double repository with Microsoft Entity Framework and other ORMs

Martin Folwer’s blog and website is a common reference for modern design pattern so we will start with his glossary definition for the repository pattern. The linked article contains more detail, but in short a ‘repository’ acts as an data store layer on top of the storage system and provides (more) object oriented methods for accessing said system. Unfortunately, something I have also seen is the over application of this pattern in combination with RDBMS ORMs leading to contorted code with unnecessary interfaces and classes. This post covers what I have seen in some projects in order to provide some of the code smellsto avoid. ...

January 4, 2015 · MichaelHughes

Of null VARCHAR fields and empty strings

How to represent a blank user input is a reasonably innocent design question. On a couple occasions though I have been bitten by systems that have been designed without considering that question seriously. Maybe it’s a clear choice to some, but today’s post makes an argument that in representing an empty input as a null is better than using a empty or blank string. ...

December 1, 2014 · MichaelHughes

Agilefall: gracefully delivering (some part of) a project on a fixed deadline

IT consulting is an odd place to be when it comes to software engineering practices. We often end up writing software for business groups that have fixed budgets and more importantly fixed deadlines. We also try to follow an agile methodology for software development that roughly follows scrum (warning: PDF), but with defined roles for a project manager and a development lead. Today’s post discusses some of the difficulties seen in using Agile to deliver business software and how we can mitigate those difficulties, basically things that worked and things that didn’t. ...

November 30, 2014 · MichaelHughes

Project War Rooms: How many ways can we interrupt each other?

Being an IT consultant has occasionally had me working in unusual or cramped quarters at client offices, the result of being hired help instead of a full time employee. One type of psychical situation I have ended up working in a few times is something we called “the project war room.” ...

September 27, 2014 · MichaelHughes

Interface mania: Considering when to add an interface for class.

Something introduced fairly early in programming courses is the concept of an interface. In practice interfaces help to define the boundaries between components of a system, define the behavior of underlying implementors of the interface, and make it easier to switch implementations of said behavior down the road. Today’s post offers a few thoughts on where interfaces should and should not be used. ...

September 26, 2014 · MichaelHughes