Solution: Creating a Hierarchy of PAC Agents

The PAC architecture defines a hierarchy of cooperating agents, each of which has responsibility for part of the application's functionality. Each agent contains three components: one for presentation, another for abstraction, and yet another for control. These three components isolate user interaction from core functionality and define cooperation among agents.

Exploring the effects of PAC

As with all patterns, certain benefits and liabilities are associated with the PAC pattern. I tell you about them in this section.

images

Although the benefits of PAC can be significant, the liabilities also can be significant — to the point that you shouldn't use PAC for some problems (see “Knowing when — and when not — to use PAC,” later in this chapter).

Benefits

Here are the benefits of a PAC architecture:

  • PAC excels at separating concerns. Each agent is exclusively responsible for a part of the application. It maintains its own state and data, coordinating with other agents when necessary. The boundaries between the agents are well defined and discrete. You can define and build each agent's internal characteristics as most appropriate. Among other benefits, this feature allows the agents to be developed independently, maybe by separate teams.
  • PAC supports evolution and extension. Because each PAC agent is separate, with a well-defined interface and ...

Get Pattern-Oriented Software Architecture For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.