##### 8.5.4.6 Partition Attribute Main

Basically, the distributed system annex (DSA) helps the user in building a distributed application from a non-distributed application (Of course, this is not the only possible model offered by DSA). The user can design, implement and test his application in a non-distributed environment, and then should be able to switch from the non-distributed case to a distributed case. As mentioned before, this two-phase design approach has several advantages.

In a non-distributed case, the user executes only one main executable possibly with a name corresponding to the main unit name of his application. With `po_gnatdist`, in a distributed case, a main executable with a name corresponding to the main unit name is responsible for starting the entire distributed application. Therefore, the user can start his application the same way he used to do in the non-distributed case.

For this reason, the configuration language provides a way to declare the main procedure of the non-distributed application.

         MAIN_PROCEDURE_IDENTIFIER ::=
           ADA_UNIT
         MAIN_PROCEDURE_DECLARATION ::=
            procedure MAIN_PROCEDURE_IDENTIFIER is in PARTITION_IDENTIFIER;

In this case, the partition in which the main procedure has been mapped is called the main partition. It includes in its code a call to this main procedure. The main partition has an additional specific role, because the boot server is located on it (see PolyORB PCS Internals).

The main procedures for the other partitions have a null body. However, the user can also modify this behavior by providing an alternate main procedure. To do this, an alternate main subprogram has to be declared and assigned to the partition Main attribute.

         PROCEDURE_DECLARATION ::=
            procedure PROCEDURE_IDENTIFIER;

         REPRESENTATION_CLAUSE ::=
            for PARTITION_IDENTIFIER'Main use PROCEDURE_IDENTIFIER;