A couple of weeks ago, I started working on the objects that needed to be mapped onto the database. As I didn’t know what to do with each of them, I tried to keep things simple by mapping a foreign key into a Long.
A couple of days ago, I realized that this foreign key actually pointed to an object that was now available. Predictable enough, but was I right to map it to a simple Long before?
Designing the first class as simply as I could was the right move. However, that’s not what I did; actually, I had added this foreign key because it was there, not because I needed it. If I had refrained from adding it as all, I wouldn’t have wasted time in trying to refactor it.
All that because I didn’t apply YAGNI properly. A lesson to remember!