Actions

In the previous section, we saw how to write event handlers for user interface components. This works great in small applications, but for larger projects, such hardwired connections between the UI and code leads to a pretty big mess. A solution is to separate the user interface from the actual code and connect them with a command pattern.

Chapter 6, Nullable Object, Template Method, Command, and State, discusses the command pattern in more detail.

As you are programming with Delphi, you're in luck. There's no need to write the complicated infrastructure that's required for the implementation of a command pattern as Delphi already implements this pattern in the form of actions.

In Chapter 6, Nullable Object, Template Method, Command, ...

Get Hands-On Design Patterns with Delphi 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.