Book Image

Hands-On Design Patterns with Delphi

By : Primož Gabrijelčič
Book Image

Hands-On Design Patterns with Delphi

By: Primož Gabrijelčič

Overview of this book

Design patterns have proven to be the go-to solution for many common programming scenarios. This book focuses on design patterns applied to the Delphi language. The book will provide you with insights into the language and its capabilities of a runtime library. You'll start by exploring a variety of design patterns and understanding them through real-world examples. This will entail a short explanation of the concept of design patterns and the original set of the 'Gang of Four' patterns, which will help you in structuring your designs efficiently. Next, you'll cover the most important 'anti-patterns' (essentially bad software development practices) to aid you in steering clear of problems during programming. You'll then learn about the eight most important patterns for each creational, structural, and behavioral type. After this, you'll be introduced to the concept of 'concurrency' patterns, which are design patterns specifically related to multithreading and parallel computation. These will enable you to develop and improve an interface between items and harmonize shared memories within threads. Toward the concluding chapters, you'll explore design patterns specific to program design and other categories of patterns that do not fall under the 'design' umbrella. By the end of this book, you'll be able to address common design problems encountered while developing applications and feel confident while building scalable projects.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
About Packt


This chapter provided an overview of four behavioral patterns. All of the patterns in this group help you to organize complex systems into well-behaved maintainable structures.

We opened up with a null object pattern. This simple pattern allows us to remove if assigned(object) tests from the code and replace them with a special do-nothing null version of the object. Although the concept behind this pattern is simple, the pattern itself can be very useful.

Next, we looked at the template method pattern. This pattern explains how to use object-oriented programming to design extensible and adaptable algorithms. We also demonstrated how we can solve such problems by using the concepts that were developed after the Gang of Four times.

The command pattern helps with organizing action-based programming. It tells us how to systematically convert actions into objects and how to separate the client code from the code that executes the action object. This flexible approach can be a base for the...