Although there have been several attempts to create grid systems, there is no clear definition for grids. In this paper, a formal approach is presented for defining elementary functionalities of distributed systems. We shall illustrate the use of a certain formal technical for developing distributed algorithms.This technique uses a so-called “event driven” approach together with the B-Method .The resulting general machines for distributed system can serve as a framework for defining new systems or analyzing existing ones.