PAC Pattern - Presentation Abstraction Control

Defines a structure for interactive software systems in the form of a hierarchy of cooperating agents. Every agent is responsible for a specific aspect of the application's functionality and every agent consists of three components: presentation, abstraction, and control.

This subdivision separates the human-computer interaction aspects of the agent from its functional core and its communication with other agents. PAC is especially applicable to systems that consist of several self-reliant subsystems. This architecture captures both a horizontal and vertical decomposition.

There should be one top-level agent, several intermediate level agents, and even more bottom-level agents. Every agent is responsible for a specific aspect of the application's functionality, and consists of the three components.

The 3 components of each agent are: abstraction, control and presentation.

Top-level PAC agent:

Provides the functional core of the system. Most other PAC agents depend or operate on this core. Furthermore, the top-level PAC agent includes those parts of the user interface that cannot be assigned to particular subtasks, such as menu bars or a dialog box displaying information about the application. It also provides the global data model of the software.

Presentation: Functions to manipulate the data model and to retrieve information about it. user-interface elements common to the whole application. Users usually initiate their actions here.
Abstraction:to provide the global data model of the software
Control:allows lower-level agents to make use of the services of the top level agents, coordinates the hierarchy of PAC agents, maintains information about connections between the top-level agent and lower-level agents and maintains information about the interaction of the user with the system.
Collaborators: Intermediatelevel Agent, Bottom-level Agent

Bottom-level PAC agents:

Bottom-level PAC agents represent a specific semantic concept of the application domain, such as a mailbox in a network traffic management
system or a wall in a mobile robot system. This semantic concept may be as low-level as a simple graphical object such as a circle, or as complex as a bar chart that summarizes all the data in the system. Bottom-level PAC agents are not restricted to providing semantic concepts of the application domain. You can also specify bottom-level agents that implement system services.

Presentation:presents a specific view of the corresponding semantic concept, and provides access to all the functions users can apply to it.
Abstraction: Similar to the Abstraction component of top level agent but no other PAC agents depend on this data
Control:maintains consistency between the abstraction and presentation components
Collaborators: Top-level Agent, Intermediatelevel Agent

Intermediate-level PAC agents:

Represent composition and coordination. When, for example, each object in a complex graphic is represented by a separate PAC agent, an intermediate-level agent groups these objects to form a composite graphical object. The intermediate-level agent defines a new abstraction, whose behavior encompasses both the behavior of its components and the new characteristics that are added to the composite object.
It also maintain consistency between lower level agents, for example when coordinating multiple views of the same data.

Abstraction: maintains the specific data of the intermediate-level PAC agent.
Presentation: implements its user interface.
Control: has the same responsibilities of the control components of bottom-level PAC agents and of the top level PAC agent
Collaborators: Top-level Agent, Intermediatelevel Agent, Bottom-level Agent


PAC usually suffers from complexity and lack of efficiency if it is used incorrectly.

The smaller the atomic semantic concepts of an application are, and the greater the similarity of their user interfaces, the less applicable this pattern is. For example, a graphical editor in which every individual object in a document is represented by its own PAC agent will probably result in a complex fine-grain structure which is hard to maintain. On the other hand, if the atomic semantic concepts are substantially larger, and require their own human-computer interaction, PAC provides a maintainable and extensible structure with clear separation of concerns between different system tasks.

Comparison with MVC:

MVC lacks mediating control components. Furthermore, MVC does not separate self-reliant subtasks of a system into cooperating but loosely- coupled agents. PAC also addresses issues that MVC leaves unresolved, such as how to effectively organize the communication between different parts of the functional core and the user interface.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License