|Developing Custom Delphi Components|
Ray Konopka (see also the latest edition of this book)
The Coriolis Group Books
585 pages (CD-ROM)
This is a special book about Delphi, not at all like all other books that introduce Delphi in all facets. No, this book is focussed on a specific topic, namely Delphi Component Building (as the title already indicates). The book is of course mainly intended for those who want to build their own components, and it includes background information on the Delphi Object Model, Exceptions, but all with Component Building in mind. While most books only have one or two chapters on Component Building, this book has four parts with a total of 16 chapters and four appendices in almost 600 pages to make sure no details are missed. At times the book may seem a little 'slow paced', but this is to make sure that every reader can keep up with it to the end, to become a true Delphi Component Builder ("build it once, make it right, and use it forever").
Due to the nature of the book and the level of detail, I would classify it as an advanced book, although earlier chapters are in fact beginners' level.
As said before, the book consists of four parts.
The first one (Component Basics) is about the Delphi VCL component versus VBX and OCX controls.
We also see why we would like (or need) to build components in the first place!
The second chapter introduces Delphi new (class) object model, followed by chapters on properties and exceptions.
By introducing exceptions in this introductionary part, the reader gets to know them well, and doesn't mind using them lateron.
The second part of the book (The Delphi Component Architecture) explores the Visual Component Library of Delphi itself. It might be helpful to have a copy of the VCL source code at hand when reading this part. After the exploration, we start to write our own components, derived from existing ones (like a new panel, a 3D-label or a listbox with tabstops). Basic examples, but ones that will get you up to speed real fast (and you can use them, too).
The third part of the book (Developing Components) is where the 'advanced' part starts: now we start building our own components from scratch! As examples we build a progress indicator, a statusbar, and we see how we can write a component wrapper around a DLL (the BWCC.DLL in this case), followed by dialogs, non-visual, and data-aware components.
The last part (Advanced Techniques) is about some more complex examples as well as the final touches of component building. First, we explore data-aware business components, property editors and component editors (the last two are used to extend the design-time interface for the component builder himself). Then we go deeper into the process of debugging a component (very helpful). The last chapter is about writing the on-line helpfule (you do want your component to be used by others, so you can call it "really reusable", right?).
The appendix contains information on Delphi32 (the 32-bit version Delphi 2.0), an overview of the standard exception hierarchy, a VCL source code overview, and a list of things that can be found on the CD-ROM (all sources of the book and a few additional handy components).
If you're a Component Builder (or you want to become one), then you cannot live without this book. Trust me...