OOP in Delphi
Understanding Delphi Class (and Record) Helpers
A feature of the Delphi language added some years ago (way back in in Delphi 2005) called "Class Helpers" is designed to let you add new functionality to an existing class (or a record) by introducing new methods to the class (record). Here are some more ideas for class helpers + learn when to and when not to use class helpers.
Interfaces In Delphi Programming 102
The 101 article was an introduction to interfaces and implementing them. This time we'll explore more topics related to working with interfaces. What to do when 2 interfaces define the same named method and you need to implement both? How to have properties in interfaces?
Don't Check For Assigned - Ensure Your Nil Delphi Objects Return Prop…
Return a Property Value From a Nil Delphi Object Wthout an Access Violation
Using Interfaces in Delphi programming?
Most Delphi developers when they think of interfaces they think of COM programming. However, interfaces are just an OOP feature of the language - they are not tied to COM specifically. Interfaces can be defined and implemented in a Delphi application without touching COM at all. Have you ever created (and implemented) your own interface and?...
Interfaces in Delphi Programming 101
If you are up to creating a rock solid (OOP driven) Delphi application in a way that your code is maintainable, reusable, and flexible the OOP nature of Delphi will help you drive the first 70% of your route. Defining interfaces and implementing them will help with the remaining 30%.
Understanding and Preventing Memory Leaks in Delphi Applications
"Any given program will expand to fill all the available memory!" Is Murphy right? This article provides some common pitfalls and best practices for writing non - memory leaking Delphi code.
Using RTTI in Delphi
Delphi provided Runtime Type Information (RTTI) more than a decade ago. Yet even today many developers aren't fully aware of its risks and benefits. This article provides an overview of the RTTI usage in Delphi for Win32.
Class procedures/functions. What they are and how to find a practical use for them.
Owner and Parent
The differences between a component Owner and its Parent - briefly explained.
Design Patterns in Delphi
Exploring design patterns in real programming, focusing on implementation issues in Delphi.
Simulating multicast events in Win32 Delphi
In Win32 Delphi OOP, only one method can be assigned as a handler to a component's event. In Delphi for .Net, multiple event handlers can be bound to the same event. Let's see how to build a Win32 Delphi object that maintains a list of the methods its event(s) is handled by - thus creating a simulation of multicast event handling.
Simulating class properties in (Win32) Delphi
A class property is a property you can access without actually creating an instance of a class. While (Win32) Delphi enables you to create class (static) methods (function or procedure), you cannot mark a property of a class to be a class (static) property. False. You can! Let's see how to simulate class properties using typed constants.
Hello, my name is Button1
"The name of a component plays a fundamental role in Delphi, but some of the features behind this property are far from well-known."
Models, Views and Frames
The text includes wizard and property sheet frameworks that can share view forms. It also discusses Delphi's interface and Assert features.
RTTI in Delphi - Extended Run Time Type Information
Prior to Delphi 2010, RTTI was available to "published" sections of a class. For example, the Object Inspector relied on RTTI to get the list of published properties and events to display, for a component. Support for RTTI in Delphi had a facelift (and that some) in Delphi 2010. Read all about it.
Understanding and Using Attributes in Delphi
Along with the extended RTTI in Delphi 2010, a new language feature was introduced: Attributes. Attributes are a language feature in Delphi that allows annotating types and type members with special objects that carry additional information. A few examples to get you started...
Enumerators in Delphi - Creating Custom For-In Iterations
The "for in" loop makes it easier to loop through the elements in a collection (e.g. characters in a string or objects in a TObjectList) by removing the need for the iterator variable, indexing each element and checking for boundaries. Interested in creating your own for in loops for your own collections?