The one example that I must have seen on about five projects now is the testDatabase(); testDatabase() has meant five different things on all of them, a different thing for each of the projects I’ve been on. Sometimes it’s been a couple of classes and meant two different things. It doesn’t describe what it’s actually testing, or give you any information about what it is that the task is doing. Whereas when you start talking about behaviour, about the responsibilities of your task - that’s interaction with things that play particular roles and you get the notion of role-based interfaces.
So you might have a shop and you might be delivering things to it, having stock in the back end and counting the stock. Each of those things has a role, to the post guys it’s a delivery place. To auditors it’s some auditable thing, it’s a tax thing, you know, because people who work there. It’s stock, got stock, those are all roles that the shop plays. Then you describe all the interactions in terms of those roles and suddenly instead of having lumps of code with data and method, you’ve got living, breathing objects, which have particular aspects of behaviour and as you get rid of the things that shouldn’t be there and you start messing around with things, it starts to fall into the domain model, we start using the domain language that the businesses use.
So the domain language is basically how the systems talk about it. So if you’re in a finance organisation, they might talk about commodities, stocks, shares, you know, options, futures, trade, transactions, whatever, however they talk about those are the objects that you should have in your system. Those are the classes you should be using. They have particular roles, particular behaviour. So you might have the stock mainframe and supposing everybody referred to the mainframe as Disciple, you write `disciple’ in your code and then everybody knows what you’re referring to, because that’s the name that everybody uses. You don’t write weird mainframey stuff that you then have to translate to the business people.

delicious
digg