Archive for the 'Design' Category
The code I’ve been looking at recently has quite some problems with managing various ids. The ids in the system are confusing on many levels, both syntactically and semantically. To begin with, there are a lot of them. They are represented using a mix of ints, longs and strings. Even the same id may be [...]
Posted in Design, Imperfection, Implementation | Comments Off
Lately, I’ve been thinking about two ways to design a system. I’m having trouble with figuring out which one I actually prefer. I’ll try to describe them below. If you would like to read through the description and leave a comment or two I would be very grateful! Feel free to just add a comment [...]
Posted in Design, Imperfection | Comments Off
To make a class as universally usable as possible, name it after its content, not its intended usage. After all, the usage might change, and you may find a new area of use for the class which you didn’t foresee. Example In the project I’m working on, I had a class called SelectedInstalledBase which represented [...]
Posted in Design, Imperfection, Implementation | Comments Off
This is a summary of what learned from a “Mastering TDD” course with Kent Beck. Given he is the creator of JUnit, I guess his thoughts on unit testing are worth considering. In some cases I might have rewritten, changed, extended or simply misunderstood what he was saying, but these were my notes from the [...]
Posted in Agile, Design, Imperfection, Implementation | 2 Comments »
An interface is a point of interaction between two systems and they are used extensively within the Java world. While the mechanics of interfaces always are the same, the semantics may differ. There are (at least) two rather distinct types of uses for interfaces in Java. One type of interface, which we might call separation [...]
Posted in Design, Imperfection, Implementation | Comments Off
Don’t peek
Monday, April 26th, 2010
When I talked to Michael Feathers about why constraints are good, he also mentioned an example of where he thought things were going wrong. Some people who use test-driven development, also use tools that allow the to peek into classes and read private variables. That is an efficient way to ensure that some method altered [...]
Posted in Design, Imperfection | Comments Off
This is the third installment in my series on sensible exception handling and will cover when and how to catch exceptions. To quickly summarize, the series looks as follows: Throwing Exceptions Using Assertions Catching Exceptions (this one) Logging Exceptions The [...]
Posted in Design, Imperfection, Implementation | Comments Off
This is the second part in a series of four on exception handling and it focuses on an area related to exceptions — assertions. A quick summary of posts in this series: Throwing Exceptions Using Assertions (this one) Catching Exceptions Logging Exceptions
Posted in Design, Imperfection, Implementation | Comments Off
This is the first post in a series of four on exception handling. The series will cover what I think is a good and sound strategy for handling exceptions and errors in your application. It is written with Java in mind, but is applicable to most languages which feature exceptions. This first issue will go through the art of throwing exceptions.
Posted in Design, Imperfection, Implementation | Comments Off
This is a bit of a rant, but I just gotta get it out of my system. I’m getting frustrated by people I talk to who seem to misunderstand the whole point of agile software development (IMHO). Different ways of reducing risk The point with agile, as far as I understand, is to reduce risk [...]
Posted in Design, Imperfection, Process | Comments Off