Data Modeling is Hard!
Map it out. Yep, simple as that. I knew what the current functionality was, so it is simple to map what's happening now to what will be happening in the new paradigm.
You know where this is going.
Not that simple.
Software engineering is messy
This is a truth not many people talk about, but it is definitively true. TRUTH!
I've seen plenty of people trying to engineer their way to perfection, but we're too squishy and unlike machines to force that.
Estimation? An art more than a science. Obviously we can give more accurate estimates due to many pieces of evidence, but still not perfect.
Bugs? Yep, they exist because not everything is designed exactly with no wiggle room. Squishy.
Data model? This is probably the closest thing we can get to planning up front and coming out on top. In the last couple weeks I've been trying to solve this the messy way.
I don't really want to call it a solution, but I'll explain what turned out to be my approach and I don't think it is far off of what I'd do next time.
I just started hacking at it. This was great because I didn't know exactly what I was getting into. About two days in I realized there was more than meets the eye on this one. It was a bit like an iceberg, but more like a 30/70 ratio of seen/unseen.
Why did this turn out well? I learned a lot about the current system. It might have been like pulling teeth (mine or others) to hash this out without hacking. Getting some one to describe all the ins and the outs of how software is designed and works is incredibly difficult. They either don't want to do it or don't want to admit they don't know it - all of it anyway. The other option is exploratory documentation. I find this tedious and puts most people to sleep. Hacking at it makes action and you get to see results. Dopamine hits!
Ok, back up! Now that I knew there was more than I thought here, I retreated and start documenting what I figured out. Here is where the mapping started. I came up with some good diagrams and lists of items and thought I was done.
Third (and fourth, and fifth, and...)
Review and revise. Do it again. And again. After writing all this down and sharing it with others, many things became clear to all of us. "Oh, we also need that over here" or "We actually don't need that any longer" are the types of comments I got. Super helpful!
Write the code (again). This time I could at least start from a place I knew more about. I'll be honest, it wasn't pretty and still took longer than I'd like it to (thank you Hibernate and JPA), but it was much more enjoyable and not so destructive this time.
I now have a model working side-by-side with the old one so I can easily swap one for the other when we're ready. Definitely not a finished product, but a really good start.