Object Pascal Handbook – Delphi 11 Alexandria Edition by Marco Cantù

Telechargé par DAR HIDJRA
Marco Cantù
Object Pascal Handbook
Delphi 11 Alexandria Edition
The Complete Guide to the Object Pascal
programming language for Delphi 11 Alexandria
Original edition: Piacenza (Italy), July 2015
Delphi 10.4 Edition: Piacenza (Italy), March 2021
Delphi 11 Alexandria Edition: Piacenza (Italy), November 2021
Author: Marco Cantù
Publisher: Marco Cantù
Editors: Peter W A Wood (first edition), Andreas Toth (second edition)
Cover Designer: Fabrizio Schiavi (www.fsd.it)
Copyright 1995-2021 Marco Cantù, Piacenza, Italy. World rights reserved.
The author created example code in this publication expressly for the free use by its readers.
Source code for this book is copyrighted freeware, distributed via a GitHub project listed in the
book and on the book’s web site. The copyright prevents you from republishing the code in print
or electronic media without permission. Readers are granted limited permission to use this code
in their applications, as long at the code itself is not distributed, sold, or commercially exploited
as a stand-alone product.
Aside from the above exception concerning the source code, no part of this publication may be
stored in a retrieval system, transmitted, or reproduced in any way, either in the original or in a
translated language, including but not limited to photocopy, photograph, magnetic, or other
record, without the prior agreement and written permission of the publisher.
Delphi is a trademark of Embarcadero Technologies (a division of Idera, Inc.). Other trademarks
are of the respective owners, as referenced in the text. Whilst the author and publisher have made
their best efforts to prepare this book, they make no representation or warranties of any kind
with regard to the completeness or accuracy of the contents herein and accept no liability of any
kind including but not limited to performance, merchantability, fitness for any particular pur-
pose, or any losses or damages of any kind caused or alleged to be caused directly or indirectly
from this book.
Object Pascal Handbook: Delphi 11 Alexandria Edition
This PDF-only version has been published on November, 2021
The last printed edition for Delphi 10.4 Sydney is ISBN-13: 9798554519963
The electronic edition of this book has been licensed to Embarcadero Technologies Inc. It’s also
sold directly by the author. Do not distribute the PDF version of this book without permission
from the author. The printed edition is published through Kindle Direct Publishing and sold at
several online outlets.
More information at http://www.marcocantu.com/objectpascal
begin - 3
begin
To my family, Raffaella, Benny, and Jacopo,
with all of my love and a big thank you for all you do
to take my life ahead of my expectations
Power and simplicity, expressiveness and readability, great for learning and for profes-
sional development alike, these are some of the traits of today’s Object Pascal, a
language with a long history, a lively present, and a brilliant future ahead.
Object Pascal is a multi-faceted language. It combines the power of object-oriented
programming (OOP), advanced support for generic programming and dynamic con-
structs, like attributes, but without removing support for more traditional style of
procedural programming. A tool for all trades, with compilers and development tools
embracing the mobile era. A language ready for the future, but with solid roots in the
past.
What is the Object Pascal language for? For writing desktop to client-server applica-
tions, to massive web server modules to middle-ware, to office automation, to apps for
the latest phones and tablets, to industrial automation systems, to internet virtual
phone networks... This is not what the language could be used for, but what it is cur-
rently used for today, in the real world.
The core of the modern Object Pascal language comes from its definition in 1995, a ter-
rific year for programming languages, given that this was also the year Java and
JavaScript were invented. While the root of the language dates back to its Pascal ances-
tor, its evolution didn’t stop in 1995, with core enhancements continuing as of today,
Marco Cantù, Object Pascal Handbook 11
4 - begin
with the desktop and mobile compilers created by Embarcadero Technologies for use
in their Delphi and RAD Studio development environments.
A Book on Today’s Language
Given the changing role of the language, its extension over the years, and the fact it is
now attracting new developers, I felt it important to write a book that offers complete
coverage of the Object Pascal language as it is today. The goal is to offer a handbook for
all, a language manual for new developers, for developers coming from other similar
languages, but also for old-timers of different Pascal dialects that want to learn more
about recent language changes.
Newcomers certainly need some of the foundations, but given changes have been per-
vasive, even old-timers will find something new in several of the chapters of the book.
Beside a short appendix covering the short history of the Object Pascal language, this
book was written to cover the language as it is today. A large part of the core features of
the language hasn’t changed significantly since the early versions of the Delphi, the
first implementation of modern Object Pascal, in 1995.
As I’ll hint throughout the book, the language has been far from stagnant during all of
these years, it has been evolving at quite a fast pace.
In other books I’ve written in the past, I followed a more chronological approach, cov-
ering classic Pascal first followed by extensions more or less as they appeared over
time. In this book, however, the idea is to use a more logical approach, progressing
through the topics and covering how the language is today, and how to best use it,
rather than how it evolved over time.
As an example, native data types dating back to the original Pascal language have
method-like capabilities (thanks to intrinsic type helpers) introduced recently. So, in
Chapter 2, I’ll introduce how to use this feature; although it won’t be until much later
that you’ll figure out how to make such a custom type-extensions yourself.
In other words, this book covers the Object Pascal language as it is today, teaching it
from the ground up, with only a very limited historical perspective. Even if you have
used the language in the past, you might want to skim thought the entire text looking
for newer features, and not focus only on the final chapters.
Learn by Doing
The idea of the book is to explain core concepts and immediately present short exam-
ples that readers are encouraged to try to execute, experiment with, and extend to
understand the concepts and assimilate them better. The book is not a reference man-
Marco Cantù, Object Pascal Handbook 11
1 / 550 100%
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans l'interface ou les textes ? Ou savez-vous comment améliorer l'interface utilisateur de StudyLib ? N'hésitez pas à envoyer vos suggestions. C'est très important pour nous!