Someone recently asked us about the jMock syntax. Why do we write:
rather than, say
are defined on our builder interfaces and chained on the same object. On the other hand,
are attached to the container—
One way to think of it is that our chained methods are keywords in our Domain-Specific Language, they're the fixed part of the language. The container methods represent values, points where users of the language can write their own extensions. In jMock, all these values are either a
. We provide common implementations of these interfaces, but users can write their own to add a behaviour that is meaningful within the domain of their application.
Post a Comment