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 a brief overview of a topic that will be discussed in the rest of the book: design patterns. We took a look at the broader picture and found that patterns are everywhere and that design patterns are only part of a larger group of programming patterns. We also learned about architectural patterns, which function on a higher level, and idioms, which are very low-level patterns. (We will talk more about architectural patterns in Chapter 11, Other Kinds of Patterns. Delphi idioms are introduced throughout this book, starting with this chapter.)

We then learned about at the history of patterns, and were introduced to Gang of Four and their Design Patterns book. We learned that patterns are not fixed in time, but are evolving, and that many patterns, especially ones dealing with parallel programming, were documented after that book was published.

After this, I gave an overview of design pattern classification, where we saw how patterns can be split into four big groups, and we learned what the most important patterns in each group are. This will help you research patterns that are not covered in this book.

The chapter ended with a short section on design principles, which represent more generic ideas than patterns. Design principles represent a foundation of a programmer's knowledge, and it is recommended that you know them, even before you start studying design patterns.

In the next chapter, we'll start discovering design patterns. I'll start with the first group (creational patterns) and give detailed examples of four design patterns: singleton, dependency injection, lazy initialization, and object pool.