Type:
The Type of an attribute specifies the range
of values the attribute can take and the operations that can be applied to the
attributes.
Signature:
Given an operation, the tuple made out of the
types of its parameters and the type of the return value is the Signature.
Signatures are generally defined for operations.
Visibility:
The Visibility of an attribute or an
operation is a mechanism for specifying whether other classes can use the
attribute or the operation or not. In general there are three levels of
visibility:
Private Attribute or
Operation (indicated by ‘-‘)
Protected Attribute or
Operation (indicated by ‘#‘)
Public Attribute or
Operation (indicated by ‘+‘)
Constraints
In this step we identify the constraints for each operation in each
class. The conditions to perform an operation and to complete an operation are
to be known to describe the operations. The various Pre and Post conditions of
the system are as follows:
/* to login purpose user must register first */
Context: user::
register(id) pre:
/* to communicate with user client in a LAN we need to
establish a connection. */
Context: user::
connect(client) pre:
/* disconnection is complete only after finishing the
chatting */
Context: user::
server disconnection () post:
Invariants and Inheriting Contracts:
Invariants are complicated conditions that are
implemented during the design that enables the developer to generate the code
easily. In the present system there are no such combinations of conditions to
describe