Skip to main content


Showing posts from September, 2014

DDD Validation

Validation within an application (specifically in terms of Domain Driven Design - DDD) can be solved in a variety of ways.A validate method on the entity/value type in questionAn IsValid property/accessor on the entity/value type in questionA separate service could be usedValidate MethodAdding a validate method would work, but the flaw with this approach is that you lack any context of what is happening to the object in question.Validate FlagSome sort of flag on the object that denotes whether or not the object is in a valid state is undesirable. Firstly it forces the developer to ensure they check this at the correct time. If the object is invalid, exactly what do you do at this point? This approach is often used with a combination of a validate method that returns the exact error messages.Validator ServicesA separate service seems less than ideal at first when you consider developing a richer domain model, but this solution has numerous benefits. Firstly unlike the two solutions abo…

Developer Diaries

A few weeks back I stumbled across a tweet which I unfortunately cannot find to give credit to. It talked about the benefit of keeping a developer diary.At the same time I was reading Getting Things Done (GTD). I felt inspired to take note of everything related to development that I do during my day to day time. This would satisfy the criteria I had for my GTD system, along with trying to emulate the success the original tweet was referring to.I don't have a fancy system. Rather I have a text file that is distributed between the numerous desktops and laptops I have access to. Here the file is synced, so I should always be up to date. Dropbox handles this for me. Each day I simply make a note of anything I think "I must remember that" or anything that happens to be useful, interesting or new. There is no complex system to this in order to keep in aligned with GTD, new points are simply appended at the bottom of the file. At the end of each week I simply group up related n…