Tuesday, May 10, 2016

Kata: Brownish Greenfield Gilded Rose in JavaScript

I did the Brownish Greenfield Gilded Rose kata in JavaScript.

I started working on it with Jordi Masramon at the last Software Craftsmanship Barcelona event. Today I did it again from scratch.

In this variant of the Gilded Rose kata you use TDD but you're "forced" to use Item which you can't modify or inherit from.

To avoid having to put up with Item limitations, I used the Adapter pattern.

I also used the Decorator pattern for the Conjured items.

However, their implementations can seem a bit peculiar because I didn't use inheritance. I just used closures and function composition.

If you're interested in the process, check the commits (I committed after each green and each refactoring step).

You can check all the code I've done so far in this GitHub repository.

No comments:

Post a Comment