Table driven development
2 min read
How do you start a new project? From my experience, most of the projects begin with a search for a verb. Not any verbs. The important ones!
The question arises, how do you spot the important one? That depends on the domain, of course.
As an example, imagine we start modeling a new system for an insurance company. The usual suspects are insurance, policy, the insured person, insured object, and so on. Add user and privileges into the mix and, we are done! We discovered all our database tables.
What's the next step?
We have to add more flavor to our models. The policy will have some end dates, an insured person, and insured objects. The insurance will have insurance amounts and particular cases it covers, e.g., broken leg. Call this risk.
Does it make sense so far? Our model is almost ready!
Finally, we can add behavior. Policy end validation, checking if the policy covers the incident, paying money to the correct person. We are ready to put it somewhere inside our model.
Does it sound familiar? I did many systems like that.
It leads to spaghetti code. It leads to losing information. It leads to generic services. It's throwing up roadblocks for your project. And you did it to yourself.
How to avoid that? Focus on behavior from day one. Try to come up with a way to model business processes. Work on a common language.
Maybe give EventStorming a try? At least try to visualize usages of your system.
After that, try to create a domain model ?