A blog about the joys and perils of software development

Tag Archives: interface

Abstraction vs Compression

In our daily communication you might hear things like “higher level of abstraction”, but what is abstraction? And how does it relate to compression? Continue reading

The Diamond Shape

How can your classes talk to each other if they don’t know of each other? Hint: a diamond might come handy. Continue reading

Object-Oriented Programming Lecture at KTH: Slides etc.

Thank you all that participated in my lecture at KTH October 26, 2011. I had a lot of fun, and we had some good discussions. For you who were not there, it was about object-oriented programming and how to write … Continue reading

Design Patterns By Example: Implementing a State Machine

How do you implement the State pattern, while separating the different concerns? We use an example to discuss how to write code easy to understand and maintain. Continue reading

Design Principles by Example: Talk to an Interface or an Abstraction?

What is the relation between design principles “Talk to an interface, not an implementation” and “Talk to an abstraction, not a concrete”? When you apply them, you want to achieve different goals. Continue reading

Object-Orientation is not Really About Objects

How do we write good object-oriented programs? Despite the name, it is not by focusing on objects. […] From time to time, you come across OO programs that has a procedural flavor to them. There are few, if any, interfaces and classes are primarily used to organize related functions with data. Writing “procedural style OO programs” like this suffers from the same problem procedural programming do: coupling. […] Continue reading

Decoupling Starts with an Interface, but Where Does It End?

Decoupling is more than just talking to interfaces. How do you write code so that nowhere in the code do your classes refer to each other? How do you write code so that you can replace a module in run-time? How do you write software using geographically distributed components? Continue reading

Test-Driven Development Done Right

A couple of years ago, I had at least two misconceptions about Test-Driven Development: (1) you should write all your tests up-front and (2) after verifying that a test case can fail, you should make it pass right away. […] Continue reading

Edge-To-Edge Unit Tests

Normally, when I write C++ code to test my C++ functionality, I tend to stay away from the “unit” level. Instead, I like tests that exercise the system edge-to-edge, resembling the interactions with the outside world as much as possible. […] Continue reading