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

A practical example

To demonstrate the practical aspects of implementing a flyweight pattern, I have put together a simple application that stores and displays information about customers. It is implemented as the Flyweight and is stored in the Flyweight folder.

A customer is represented by an ICustomer interface, defined in the Customer unit as shown here:

type  TPersonalInfo = record  public    ID: integer;    Name: string;    Address : string;    constructor Create(const AName, AAddress: string);  end;   ICustomer = interface ['{1AE32361-788E-4974-9366-94E62D980234}']    function GetCompanyInfo: TCompanyInfo;    function GetPersonalInfo: TPersonalInfo;    property CompanyInfo: TCompanyInfo read GetCompanyInfo; property PersonalInfo: TPersonalInfo read GetPersonalInfo; ...
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