Wednesday, 2 September 2009

It's all about the language

In software development it is very important to name your classes, methods, properties, etc in the right way, so you can find them quickly. It is also important to name them the way you talk about them, this became very clear to me during my current project.

The project I am currently working on is a project for solicitors. The project is only focussing an a relative small part, namely invoice creation.
Solicitors are working with cases (at least here in the Netherlands they are). For such a case they create an invoice. In this new software they want to choose from several types of things, when they are involved in selling/buying a house, they want to choose that specific invoice model and when they are involved in setting up a will, they want to choose that invoice model.
Each model has some elements. In case of selling/buying a house there is a transaction, some tax and other important stuff.

This is really simple, but when I stepped into the project, there where not such types. Instead there where some types called Case, CaseComponent and CaseComponentAspect. Every day there was a discussion between the developers and the domain expert about what the meaning of these types where. At some point the developers made a "conversion list" telling what the domain expert said and how they called it.
According to the domain expert these things where called: Case, InvoiceModel and InvoiceElement. This is exactly how I expected it to be and soon I pushed the other developers to change it. After the refactoring there weren't any discussions about the naming and everything is clear to everyone.

Therefore, please choose your type names carefully, so that every member of the team knows where you are talking about...

No comments:

Post a Comment

Note: only a member of this blog may post a comment.