Archive for the 'Implementation' 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
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 »
I was extracting smaller methods out of existing big ones, in a class I was working on. Some of these extracted methods became “utility methods”: they would perform some operation on the parameters given to it, but not use any of the fields in the class. These methods could just as well have been static. [...]
Posted in Imperfection, Implementation | Comments Off
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
This is the last part of my series on exception handling which will deal with logging exceptions and other noteworthy events. A summary of the series: Throwing Exceptions Using Assertions Catching Exceptions Logging Exceptions (this one) General guidelines We’ll start [...]
Posted in Imperfection, Implementation | 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
Again, the book Test-Driven Development: By Example by Kent Beck provides me with an eye-opening experience. It explains how test-driven development is useful for scope control when developing.
Posted in Imperfection, Implementation | Comments Off