Delphi is a software product that uses the Delphi dialect of the Object Pascal programming language and provides an integrated development environment (IDE) for rapid application development of desktop, mobile, web, and console software, currently developed and maintained by Embarcadero Technologies. Delphi is known for its fast compilation speed, native code, and developer productivity. Borland originally developed Delphi as a rapid application development tool for Windows as the successor of Turbo Pascal.
In this article, we will go over everything you need to know about modernizing Delphi apps and look at some of the most important points mentioned by senior Embarcadero members that you should keep in mind when modernizing UI Delphi apps with the Windows UI toolkit.
Table of Contents
How to upgrade Third-Party components?
First of all, you should ask yourself which third-party libraries and components are you using with your legacy Delphi or C++ builder project? Having the source code for these components makes it easier because you can just take that existing source code, drop it into the current version of Delphi builder and rebuild it. Now you have a library that will work with the current Delphi/C++ builder that you want. Any third-party libraries or components that do not have this source code still need the upgraded version for the current Delphi / C++ build you are using.
There is a good chance that some, if not all of your third-party libraries and components can be found on the GetIt Package Manager. You can search and install directly into the Delphi or C builder. This saves you a lot of time and effort trying to find a version of these third-party libraries of components compatible with the current version of Delphi.
Should you update your app to use Unicode?
A lot of people believe that updating their apps to Unicode is a lot harder than it is. You need to ask yourself if your application needs Unicode, or can it live as an English-only application? If your existing code only uses ‘single-byte’ (English standard alphanumeric characters and punctuation) and you do not need to support Unicode characters in your code, then you might be able to get away with avoiding Unicode altogether. It is a perfectly valid technique to use instead of string or Unicode string.
There is a wonderful utility called the Unicode Statistics Tool, also known as The Parser Executable. It returns some objective measures on the likely complexity of your Unicode migration.
The good news is that the compiler is smart enough to tell you where and if any Unicode changes need to occur. The Unicode migration has always been a lot easier than folks think it will be. The good thing is that after you go through the process of Unicode migration, your code will now allow you to now distribute that application to larger markets for supporting Unicode character and Unicode strings.
It also makes upgrading between future versions of Delphi a lot easier.
Do you have the latest database technology?
You should seriously consider moving away from the BDE (Borland Database Engine). Yes, it was extremely popular for many years but it has also been LONG deprecated by Embarcadero and has not been actively upgraded for the last 15 years. The BDE cannot support Unicode and will never have 64-bit support. So you really should update any application which relies on the BDE to a newer alternative. The newest, most performant data access component is called the FireDAC.
To make that migration easier, this utility called reFIND knows how to upgrade from the BDE to FireDAC automatically. The good news is you do not have to spend or waste any time upgrading from the BDE to the FireDAC. Just run reFIND. It will search and replace all your BDE syntax and replace it with the FireDAC equivalent.
By moving from BDE to FireDAC, you move more towards queries rather than opening up a table and filtering through it. You can also be a little bit more efficient about how you are accessing the data and what data you are accessing as well. Plus, you get some added security features and things like that by moving from certain databases towards some of the newer ones that are out there.
Security is a huge thing in the world of databases and database up-gradation for data accessing. By moving to FireDAC, you are opening yourself up to Sequel Server Interface, Oracle databases. You are also getting a lot of the particular features in those databases. You can interact with them at a much better level.
Are you using an older version of middleware?
Some legacy customers still use older inter-process technology versions, commonly known as the Midas (COM) technology. It was a common solution for middleware. That technology is now replaced with Datasnap (HTTP) or the most performant middleware layer known as RAD server.
Suppose you had a multi-tier application using Midas for middleware. In that case, you now need to consider replacing Midas with either the Datasnap solution or the most performant out-of-the-box RAD server. The good news is that there are some very good white papers written that show you how to go from Midas to Datasnap or how to go from Datasnap to RAD server.
Now the Delphi users can benefit from the web and mobile-ready data. Being able to migrate that middleware to RAD Server or even Datasnap lets them expand their application base and user base.
What is the best method to get rid of runtime errors?
Sometimes you get runtime errors, such as a property on the form no longer exists, or you might be using some old DLL that no longer exists on your device. These specific runtime errors need to be fixed, and you do not know about them until you start to run the application.
The older versions used to have a property in the designer. For instance, the column count for a grid that used to exist there but now with the newer version for some reason, they remove that property from the designer. When the application runs, it calls the column count on the grid but does not find it and raises a runtime error. Then when you go to search for that column count variable in the source code, you cannot find it because it does not exist in the source code. It is only on the form.
In such cases, you go to the DFM, search for that property and either remove it or replace it to whatever it has been changed to.
Why is UI modernization important?
UX has become one of the biggest hot ticket items out there. So having the best user experience, the best user interface for your end-users tends to be one of the most important things when it comes to modernizing or updating an application. For instance, you should take advantage of all these extra cool features that Microsoft has added; the VCL styles.
UI tends to be one of the first things that end-users look at. You might have fixed all your runtime errors, but when it comes down to it, you want your application to look great because if it does not, your end-users will not be delighted with the application. So actually, you should keep it in mind to make it look visually appealing.
Experienced developers know that retaining users can be a challenge, so they continuously invest in making their applications faster, more functional, and more user-friendly. This effort is not for the user alone – cleaning up unused and inefficient code makes it easier for the developer to maintain apps moving forward.
Take advantage of these expert suggestions and modernize your Delphi app. For more information, visit their website.