In my previous post, I made statements about scoping [autonomous] services. After thinking about the statement more, I realized that it reminded me of the spirit of the law of demeter. The law of demeter guides message passing in OO. It basically states that an object should only send messages to:
- Itself
- Its attributes
- Parameters passed to it in the current method context
- Objects contained in a collection it holds
- Objects it creates itself
The spirit of demeter is that you, as an object, should minimize the number of assumptions you make about the implementation of the objects you reference and message. The same idea is true of services. If you are expected to depend on them, then the side effects must be explicit in the contract. Unfortunately, or maybe not so unfortunately if you actually want to get something done as opposed to waiting around for the spec lords to define a solution, the way that you define these assumptions currently is prose, ala WS-Transfer.
Comments