Archive for February 2015

Week 9, year 2015

  • Exceptions for flow control in C# - The use of exceptions for flow control was raised quite a few times already (here’s a c2 discussion and here is a great question on SO). I’d like to summarize this topic and provide some common use cases along with code examples to handle them. Exceptions for flow control: why not? Generally, code is read more often than written. Most of the best practices aim to simplify understanding and reasoning about the code: the simpler code, the fewer bugs it contains, and the easier it becomes to maintain the software. [Enterprise Craftsmanship]
Permalink | From 23 February 2015 to 01 March 2015 | Last updated on: Mon, 23 Jan 2023 20:36:54 GMT

Week 7, year 2015

  • C# code contracts vs input validation - Input validation rules are often taken for code contracts. In this post, I’ll try to cover their differences and show what their common use cases are. [Enterprise Craftsmanship]
  • Form, Command, and Model Validation - Many of the frameworks I’ve worked with, promise to separate responsibilities with MVC. In practice, they end up coupling everything to everything. The forms are coupled to the models, and there’s a grand unified validation layer. This may be convenient at first, but it breaks down for larger systems, and creates headaches when having to support multiple clients. My approach is to clearly separate the validation for the form itself, from the Command validation and the model validation. Commands A Command is a message that represents the intention of the user. [Mathias Verraes]
Permalink | From 09 February 2015 to 15 February 2015 | Last updated on: Mon, 7 Jun 2021 09:18:52 GMT

Week 6, year 2015

  • How to Upgrade CQRS Events Without Busting Your Event Stream - Events are at the heart of a CQRS Event Sourced system. Which is why changing or upgrading them can be problematic. In this post I’m going to cover a few principles to bear in mind, which should help you avoid hitting the rocks. Before I dive into ‘how to upgrade CQRS events’ I’m going to […] [Learn CQRS and Event Sourcing]
  • Shared library vs Enterprise development - Most of the development principles are applicable to any software you might develop. Nevertheless, there are some differences between building a reusable library and an enterprise application. Those differences often become sticking points as we try to apply experience gained in one type of project to projects of the other type. The differences between shared library and enterprise development grow from differences in requirements and lifetime support cycle. [Enterprise Craftsmanship]
  • When inheritance is not an inheritance - Nowadays, notion of composition over inheritance is quite widely accepted. It basically means that when designing a software, you should prefer composition to inheritance, although you could use either one. But what if several classes do have some common attributes? Do you need to extract a base class for them? When inheritance is not an inheritance In OOP, inheritance stands for "is-a" relation. That is, a class A can be treated as a sub-class of a class B if A *is* a B in a way that makes sense for our particular domain. [Enterprise Craftsmanship]
Permalink | From 02 February 2015 to 08 February 2015 | Last updated on: Mon, 7 Jun 2021 09:11:15 GMT