Sign in

It’s the last SOLID principle: the Dependency Inversion Principle:

The general idea of this principle is simple; If high-level modules depend on low-level modules, we should change (invert) that, and both high level and low-level modules should use abstractions, not implementations.

Let’s start with the difference between high-level modules and low-level modules. High-level modules are modules that provide or use complex logic and are using other modules or classes. Low-level modules are more like ‘utility’ modules…

SOLID principle 4: Interface Segregation. “Clients should not be forced to depend upon interfaces that they do not use.”

The interface segregation principle is about finding the most appropriate abstractions in your code. Wikipedia has a nice description of this principle: “ISP splits interfaces that are very large into smaller and more specific ones so that clients will only have to know about the methods that are of interest to them. Such shrunken interfaces are also called role interfaces “.

Let’s have a look at our previous Delphi interfaces from the Liskov Substitution Principle:

IBaseEmployee = interface
<getters and

The Liskov Substitution Principle in Delphi! I start with the official definition:

Subtype Requirement: Let Φ(x) be a property provable about objects x of type T. Then Φ(y) should be true for objects y of type S where S is a subtype of T.

Still here and wondering what that means? Good, I had some trouble understanding this too. 😊

Let us take a more practical approach to LSP: The principle defines that objects of a superclass shall be replaceable with objects of its subclasses without breaking the application. …

The second principle of SOLID is the Open/Closed principle: ‘Classes and other entities should be open for extension but closed for modification’. This article is about how in Delphi you keep a class closed for modification, but open for extension.

Let me emphasise one part; achieving this goal via inheritance or overriding classes is a bad idea in my opinion. If you want to read more about this, check out what Bertrand Mayer and Robert C. Martin have to say on this subject.

Okay, let’s take the following example:

TShip = class
// This is the actual ship

Today, we’ll dive into the S of the Solid principles: The Single Responsibility Principle. But before we start, just a quick refresher on Solid.

SOLID is an acronym for a set of five software development principles, which if followed, are intended to help developers create flexible and clean code. The five principles are:

The Single Responsibility Principle — Classes should have a single responsibility and thus only a single reason to change.

The Open/Closed Principle — Classes and other entities should be open for extension but closed for modification.

The Liskov Substitution Principle — Objects should be replaceable by their…

Photo by Kelly Sikkema on Unsplash

Always wanted to know how to use Dependency Injection with Delphi? I’ve set up an example for you in which we go from strongly coupled code to beautiful, uncoupled code in a few steps via Dependency Injection and with the help of interfaces.

We’ll start with the following example:

unit DI1;interfacetype
TLanguageTools = class
procedure CheckGrammar;
procedure Translate;
TWordApp = class
FLanguageTools: TLanguageTools;
constructor Create;
implementationconstructor TWordApp.Create;
FLanguageTools := TLanguageTools.Create;
{ TLanguageTools }procedure TLanguageTools.CheckGrammar;
procedure TLanguageTools.Translate;

As you can see, there…

As a developer, you can always improve yourself, acquire skills, learn to program better. This can be done simply by programming more (and thus learning from the mistakes you make), but if you really want to get a push, you can best make use of the knowledge of others. That’s why at GDK Software we have a policy that you can always buy books at the expense of the company. You’ll earn this investment back in no time.

At GDK Software we work with both Delphi and Mendix. …

Photo by Carlos Muza on Unsplash

Last week, I analysed the top 1000 Delphi projects on GitHub, mainly out of curiosity, and also to play with another programming language (Python). I took Delphi projects because we at GDK Software have many customers with this programming language.

To be able to do the analysis, I did the following steps:

Photo by Leone Venter on Unsplash

The absence of a good package manager in Delphi is, after 25 years, still a big problem. There are a lot of excellent third party components and libraries available for Delphi. It is what makes the development in Delphi so easy.

Unfortunately it also causes a problem with new installations, or when taking over a project from someone else. If you don’t have the right libraries and components installed you have a problem. Wouldn’t it be great to have a package manager -as available for many other languages and platforms- to resolve this automatically? …


This year (2020) Delphi celebrates its 25th anniversary. In those 25 years an enormous amount of code has been written. Many of these applications are still in full use by companies and individuals. This shows the power of Delphi; code written decades ago still works, even in the latest Delphi versions.

Still, there are some remarks to be made about this praise. Unfortunately we see that there are also many applications that are still being developed in old Delphi versions. That is a pity, because the new versions of Delphi really have a lot of advantages. …


Co-owner of GDK Software, Delphi developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store