Sunday, May 26, 2013

Kata: "Birthday Greetings"

@CoGaNic and I have done the Birthday Greetings kata.
This kata is a simple refactoring exercise by Matteo Vaccari that is meant to teach something about dependency inversion and dependency injection. You can download the kata initial code from here.

We refactored it to decouple the domain objects from the file system and email sending code using the ports and adapters architecture as the exercise suggested. You can see the refactoring result on GitHub.

We think there's still room for improvement in the adapters code, but we are satisfied with how we manage to eliminate the initial coupling between domain objects and the infrastructure classes used to read files and send emails. Now the domain objects don't know anything about them.

All in all, it's been a great exercise. We've thought about dependency inversion and dependency injection (this great article by Brett L. Suchert helped us a lot: DIP in the wild) and clarified many doubts we had about the ports and adapters architecture, also known as, hexagonal architecture.

PS: Some time ago I posted some useful links about the ports and adapters architecture.

----------------------------

Update:
I revisited the kata some time after this post, recorded a screencast to document the refactoring process and wrote a new post about it.
Check it here.

Tuesday, May 7, 2013

Interesting Talk: "Clean Architecture"

I've just watched this interesting talk by Robert Martin about software architecture:
He explains how to protect your business or domain objects from details like the framework, the user interface or the persistence infrastructure, so that domain objects become again the center of your system.
He also talks about how good architectures help to defer tool decisions until late in the development.

Interesting Talk: "The Insufficiency of Good Design"

I've just watched this interesting talk by Sarah Mei about the importance of team communication patterns in software development:

Monday, May 6, 2013

Interesting Talk: "What is OO really?"

I've just watched this interesting talk by Robert Martin that busts some myths about OO:
Some of its contents appear in this other talk, but using a slightly different perspective. There are also some different examples and anecdotes.