It’s hard for me to convince our architect that a domain model should have only the essential elements of a business domain on it. Things like the fact that the class is stable, that it needs to be journaled and audited, and that it has a RESTful URI, does not have to manage the domain model. They can be added later using interfaces.
Our healthcare information management system. At a very crude level, this is a system in which users register and gain access to their medical information. They can share this information with others and be the custodian of the information of others (think Roles). But due to several audio bytes that were caught early on: “Everything should be a REST resource” - the model now has a top-level class called “Resource” from which any other class is distributed.
I'm trying to make him understand that the domain model should be governed by clearly defined concepts, such as User Account, HealthDocument, UserRole, etc., which are separate business objects, with certain associations between them. Combining everything into a resource class allows our model to be inflexible, and not to be potentially incorrect - if everything is a "resource", as the concept of "user accessing a resource" is depicted.
But he wants me to show him why his bad idea to do it his own way. I don’t know how to formulate this correctly, but all my OO instincts tell me that this is simply wrong. Any thoughts?
source share