Drinking Coffee by the Pint
This morning I am working on the CORM project from inside of the Espresso Royale Caffe in Dinkytown, USA, while drinking coffee by the pint. I think that there are several archetectural problems with the Enterprise Patterns book by Arlow and Neustadt. This morning I am dealing with the problem of persisting Address objects.
Persistence requires some sort of identity mechanism inside of the datastore, by which we can refer to a given object. Each object should be uniquely identifiable within the datastore. Inside of the Enterprise patterns book, however, few of the archetype patterns mention their method of Identity.
The Party archetype has a predefined PartyIdentifier archetype, which can be used to uniquely determine the party in the datastore. However, a Party can have multiple Address objects. How do we identify those? "No problem," you might be thinking, "just use the PartyId object." Ah, but therein lies the rub--an address may belong to multiple parties. For instance, I share an address with my roommate, Charlie Demerjian. He's a party (and a riot, but that's beside the point). We both share an address with his company, Stone Arch Network Solutions. SANS is also a party. I also have an e-mail address, which is not the same as my street address. Thus, I have multiple addresses, and some of my addresses belong to multiple parties. Clearly, Address objects require their own ID object.
Which is not a problem, really--it's just that the Arlow/Neustadt book didn't forsee that need. The whole episode serves as a reminder not to follow any map off a cliff, and it reinforces my willingness to deviate from the insanity of MDA to create a working implementation of these patterns.
