摘要 |
In a distributed system, a method and apparatus for automatically checking objects according to a specification which includes public contracts and private constraints. Public contracts are obeyed by both client and server, while private constraints are obeyed by either client or server, but for a given private constraint, not by both. At each and every stage of a client-to-server or server-to-client transaction or "call", the objects or parameters related to call are automatically checked to ensure a specification is met. A client-side stub on the client automatically generates and executes checking code to check both private client-side constraints and public contracts on the client prior to network transfer to a server. The server has a server-side skeleton which intercepts the call and objects. The server-side skeleton performs checking by code automatically generated to check the public contracts, if any, with client and any private server-side constraints. Once checking is complete, the call is processed and a server "return" is the result. The return object is then transferred across the network to the client. The client-side stub then performs automatic checking according to the specification of the return object which may be different from the specification checked for objects related to the call initially sent by the client.
|