Skip to Main Content
Mastering Delphi Programming: A Complete Reference Guide
book

Mastering Delphi Programming: A Complete Reference Guide

by Primož Gabrijelčič
November 2019
Beginner to intermediate content levelBeginner to intermediate
674 pages
15h
English
Packt Publishing
Content preview from Mastering Delphi Programming: A Complete Reference Guide

Delphi idioms – helpers

As you can see, writing decorators can result in lots of very tedious work. If you check the DecoratedStream unit, you'll see more than 900 very boring lines. Is there a better way?

The answer to that is both yes and no. It's no if we want to stick to traditional decorator implementation, but it's yes if we are a bit more pragmatic than that and we use a Delphi-specific concept of helpers.

Delphi helpers give us a way to extend existing classes, records, and even simple data types with new methods. They work in the same open/closed way as decorators. The original class, record, or data type stays the same (is closed), but as far as the other parts of code are concerned, it is extended with the new functionality (is ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Delphi GUI Programming with FireMonkey

Delphi GUI Programming with FireMonkey

Andrea Magni
Delphi Cookbook - Third Edition

Delphi Cookbook - Third Edition

Daniele Spinetti, Daniele Teti

Publisher Resources

ISBN: 9781838989118Other