PC2v9 Architectural Overview - pc2ccs/pc2v9 GitHub Wiki

The overall organization of PC² is based on a Client-Server architecture. Each site in a contest runs a single PC² server, and also runs multiple PC² clients which communicate with their site's server[1]. The types of clients which might be running in any given contest include the Admin, Application Team (or just Team for short), Judge, Scoreboard, and Event Feed (or Feeder for short).

Client modules communicate only with the PC² server at their site; clients never communicate directly with each other or with any server other than the one at their site. (However in some cases the server will forward messages which it receives from one client onward to another client, or to another site’s server.)

The architecture within each PC² module (server or client) is based on the Model-View-Controller (MVC) architectural pattern. When a PC² module (Server, Admin, Judge, Team, etc.) is started on a machine, that module contains a model which holds the data associated with the contest; a view which shows a particular representation of the model; and a controller which provides methods for manipulating the model. (This is discussed further at the PC2 MVC Details page.)

When a module is first started, it displays a standard common LoginFrame view (GUI) and waits for the user to enter a valid account name and password. It then uses the account type associated with the specified account name to determine what "view" to display next: logging in with an Administrator account displays the AdministratorView GUI; logging in with a Judge's account displays the JudgeView GUI, etc. The current view is initialized with the current model (contest) and controller, and the fields in the view are populated from that data. The GUI view then waits for an interactive user operation (a command to do something); user actions can either display additional frames or dialogs, or update the contest model by invoking methods in the controller.

Some controller methods operate only on data within the module's model. However, other controller methods are designed to communicate with other PC² modules. This communication is done using the Client Server Organization built into the PC2 system.


[1] A site in a PC2 contest is a logical grouping of clients, together with a single server, irrespective of physical location. A single “site” might consist of teams and judges in widely-separated physical locations (different cities or countries, for example), all communicating over the Internet with their (single) site server. Alternatively, a contest might be run in “multi-site mode”, with different groups of clients each communicating with their own site server (in which case the servers also communicate with each other to maintain the overall state of the contest).

⚠️ **GitHub.com Fallback** ⚠️