UNPKG

service-model

Version:

An object oriented web service framework inspired by Windows Communication Foundation.

37 lines (36 loc) 1.19 kB
/** * A description of a service contract operation. * * <uml> * hide members * hide circle * ContractDescription *-- OperationDescription : operations * OperationDescription *- OperationBehavior : behaviors * OperationDescription *-- Method : method * </uml> */ var OperationDescription = (function () { /** * Constructs an [[OperationDescription]]. * @param contract The contract that owns the operation. * @param method The service method that is called by the operation. * @param name The name of the operation. If not specified, defaults to the name of the method. */ function OperationDescription(contract, method, name) { /** * A list of behaviors that extend the operation. */ this.behaviors = []; if (!contract) { throw new Error("Missing required argument 'contract'."); } if (!method) { throw new Error("Missing required argument 'method'."); } this.contract = contract; this.method = method; this.name = name || method.name; } return OperationDescription; })(); exports.OperationDescription = OperationDescription;