Skip to main content

Posts

Showing posts from January, 2016

Getting Things Done - For Software Developers

I have been using the incredibly simple techniques within Getting Things Done (GTD) to good effect over the last twelve months.The SystemAt a high level the system consists of buckets, grouping and a task store. The actual implementation of GTD systems is down to personal preference. Many find their system changes and evolves over time.BucketsHave one or more buckets which act as simple dumping grounds for anything you need to do. My phone, pen and paper and post it notes are the three core buckets I use.Buckets are where you store anything that takes more than a couple of minutes to do. If something takes less time, just do it there and then. Regularly empty the buckets and assign them to groupings of related items. Example groupings include tasks around the house, work projects, blog items, or items to buy.GroupingEach grouping can then be allocated a priority. Each grouping essentially becomes a mini kanban board.Grouping is preferred to having one big todo list as different scenar…

A Lotta Architecture - A Reply to "A Little Architecture"

A recent post about architecture from Uncle Bob got me thinking and talking about a typical day in the life of a developer. It's well worth a read. In fact at the time of writing this reply there are 347 retweets and 288 likes - of which I was one of those statistics.The advice is practical and advice that I agree with. Except this is not the full story. While deferring architectural decisions as late as possible is a good thing, such details actually tend to be the most important, costly and difficult parts of an application.In the example the BusinessRuleGateway allows the business logic to be coded in pure isolation, using a stub or fake. This is fantastic and provides numerous benefits. Sadly the actual implementation of the gateway requires knowledge of MySql. This may be obvious but the decision of what database to use cannot be deferred or ignored forever.Once chosen you will require intricate knowledge of how it works and is implemented. When things go wrong and you are st…

Validation is not a Cross Cutting Concern

Attributes in C# are also known as decorators in Python or annotations in Java. Other languages may have similar constructs. This post will use attribute throughout but refers to the same concept.While attributes prove useful for cross cutting concerns such as authorization or logging, they can be misused. Attributes should act as metadata, providing no direct behaviour. Failing to do so will make DI, testability and composition very difficult.These flaws are especially true for validation. Despite all input requiring validation, the manner in which validation is performed is dependent on the entry point to the code. Context matters.Consider order information that requires a billing address and by definition, its children to be populated. An attribute works a treat here in this simple case.A problem arises if you only want the billing address validation to activate if the billing address and delivery address differ.Complexity quickly starts to take over. With a more fully featured exa…

Application Validation and Domain Validation

There are two types of validation in an application - application validation and domain validation. This applies whether or not you practice DDD. One of my mistakes in the past has been confusing or conflating these two responsibilities at the same time.Application ValidationApplication validation is anything technical or anything domain experts would likely scratch their heads at. Examples include:is the input null?is the input whitespace or empty?is the input within ranges for the datatypes used?is the length of the input suitable for the DB?Application validation should occur in your application service, along with other technical aspects such as transactions or configuration. This is due to different applications having different technical requirements. For example a HTML frontend may differ to a web service, so application validation would need to vary also.This form of validation is best performed using validation services. The use of attributes/decorators/annotations can also b…