Leveraging What You Have: 10 Top Things Added to Delphi Since Delphi 7

By: Pawel Glowacki

Abstract: You may not be aware of all the great stuff that has been added to Delphi over the years.

Introduction

I've been using Delphi since its first release, and have been watching over the years how this great product matures and evolves. Delphi 7 was the last Delphi release based on the same IDE-core as Delphi 1. Many developers are still using older versions of Delphi and probably are not aware of all the great stuff that was added to Delphi after Delphi 7. CodeGear RAD Studio 2007 is the fifth version of the IDE based on the new multi-personality IDE core "Gallileo". Many features and technologies have been added to Delphi over the course of these five IDE versions.

  • Galileo 1.0 - C#Builder 1.0. This was the first incarnation of Galileo. It contained C#Builder IDE personality only.
  • Galileo 2.0 - Delphi 8 for .NET. The Delphi for .NET IDE personality has been added.
  • Galileo 3.0 - Delphi 2005. The first version of Galileo with Delphi for Win32 IDE-personality.
  • Galileo 4.0 - Delphi 2006. The second version of Galileo with Delphi for Win32 IDE-personality. Lots of improvements in Delphi for Win32 compiler. C++Builder IDE-personality has been added to the mix.
  • Galileo 5.0 - CodeGear RAD Studio 2007 aka Delphi 2007. The latest Delphi version.

Below is my subjective list of Ten Top Reasons to upgrade to RAD Studio 2007 aka Delphi 2007. I like Delphi for .NET programming very much. Especially .NET 3.x programming, however this list focuses primarily on Delphi for Win32 development, and does not contain super cool features like Delphi ASP.NET 2.0 programming or C++ support.

Things that did make it into the Top Ten…

  • UML Modeling
    • LiveSource technology
    • Audits and Metrics
    • GOF Patterns
  • VCL for the Web (IntraWeb) framework for native Delphi web development with seamless AJAX support
  • Vista Support
    • TCustomForm.GlassFrame property
    • TTaskDialog component
    • Vista APIs support in the VCL
  • Integrated and Included Features
    • InterBase 2007 Developer Edition
    • Blackfish™ SQL for Windows
    • Doc-o-Matic Express
    • InstallAware Express CodeGear Edition
    • Rave Reports
    • Indy 10
    • glyFX Icon Library – CodeGear Edition
    • TeeChart 7.0
    • Wise Owl Demeanor for .NET, Personal Edition 4.0
    • Microsoft ASP.NET 2.0 AJAX Extensions

10. New "Galileo" IDE

Nick Hodges created a very nice list of "New IDE features since Delphi 7" .

  • Tool Palette
  • Welcome Page
  • Floating VCL Designers
  • Project Page Options
  • Folders in Project Manager
  • Object Inspector (filename, navigability to linked components)
  • Structure Pane
  • Centralized Options Dialog
  • Editor:
    • UTF8 and Unicode Support
    • SyncEdit
    • HelpInsight
    • ChangeBar
    • Collapsible Region
  • Data Explorer with Visual Query Builder
  • HTML Editor
    • Live Templates support
    • WYSIWYG Designer
    • Treeview
  • Deployment Manager

New build engine is based on MSBuild technology. Project file is XML-based, and new Delphi project file extension is "*.dproj".

  • Multiple Personality IDE
  • Named Build Configurations
  • Configuration Manager works across projects
  • Scriptable Pre- and Post-Build Step Events

Few words about Help Insight from Corbin Dunn Blog

"Delphi 2005 has a cool new feature called Help Insight. When you move the mouse over a symbol and wait for a second, the IDE grabs the XML documentation for that symbol and dynamically displays the help for it (if available). (...) If you want, you can customize the look of the Help Insight window. It simply is a mini-web page. Inside the ObjRepos directory, you will find HelpInsight.css and HelpInsight.xsl. By tweaking the .css file, you can easily control the look of the page. By tweaking the .xsl file, you can control the layout of the page."

9. New Components

8. Delphi Language and Compiler

Nick Hodges created a very good reference to New Language features since Delphi 7 .

Below some highlights:

  • Delphi Language
    • Generics (parameterized types) in Delphi for .NET (Win32 is coming)
    • “for in do” loop iteration
    • Operator overloading
    • Nested Types and Nested Type Constants in Class Declarations
    • Records with methods
    • Class variables/class static data
    • Custom variants with support of your own data types, complex numbers, safe arrays, and passing variants through data sets
  • Compiler
    • function in-lining for increased application performance
    • Support for Unicode and UTF8 Formats
    • XML Documentation Generation
    • New versions of RTL functions from FastCode: LowerCase, UpperCase, _LStrComp, CompareStr, and StrLen

7. Debugger and Memory Manager

  • New Memory Manger: FastMM community memory manager
  • Disassembly pane has “Show Opcodes” and “Show Addresses” local menu items
  • New Debugger Options: "Scroll new events into view" and "Ignore non-user breakpoints"
  • Call Stack View shows a glyph indicating if the frame has debug info
  • Evaluator Frame Support for Win32 Local Variables
  • CPU view panes can be opened individually outside of an editor tab
  • Call Stack view now automatically syncs the Locals view when you double click an item

6. Unit Testing

  • Integrated unit testing with the DUnit testing framework (and NUnit for Delphi for .NET)
  • Unit test wizards for quick and easy unit test and unit test project creation
  • Unit test code generation with full code to invoke each method
  • Update existing unit test cases with new test methods
  • Execute unit tests from project manager

5. Template Libraries

Template Libraries is new powerful repository mechanism introduced in RAD Studio 2007.

Template Libraries RAD Studio allows you to create multiple custom template libraries to use as the basis for creating future projects. Template libraries let you declare how a project can look, and enable you to add new types of projects to the New Items dialog box. Creating a template library is a two-step process.

First, you create a RAD Studio project to use as the basis for the template, and an XML file with a .bdstemplatelib extension that describes the project. This project can be any kind of project that RAD Studio supports. Next, you add the project to the list of template libraries in the IDE by pointing to the .bdstemplatelib template library file in the Template Libraries dialog box, accessed with ToolsTemplate Libraries. You can create your own template libraries, and you can use those created by other developers. RAD Studio delivers a default template library which cannot be removed, however you can add and remove custom template libraries.

Note: When creating a project to use with a template library, make sure the project is located in a subdirectory that contains no other projects. All of the files that are in the project should be located within the subdirectory or child subdirectories.

You can either create a single .bdstemplatelib template library file for each template library project, or list several related template projects in the same .bdstemplatelib template library file by assigning each project a separate unique item number.

From the list of preinstalled templates that come with a default installation of RAD Studio 2007 you might get an impression that "Template Libraries" are only used for so called "improved start-from-scratchability" (a term coined by Jim Tierney, Delphi R&D Engineer) for Delphi ASP.NET 2.0 MasterPage-based web applications, but in fact this mechanism can be used for other types of RAD Studio 2007 applications. According to help there are four types of projects that can be created with template libraries. The type of project is specified using one of a predefined values for "Creator" attribute inside the bdstemplatelib xml file:

Currently Template Libraries support the following types of projects:

  • C++ Projects
  • Delphi for Win32 Projects
  • Delphi for .NET Projects
  • Delphi for ASP .NET Projects

4. Local History

The History Tab functions as a very simple source control system. Each time a file is saved, a backup is made and stored in a subdirectory. The IDE tracks these follows and allows the developer to review earlier versions of the file using a diff engine. If an older version of the file is needed, it can replace the existing file.

3. New DBX4 Database Architecture

Steve Shaughnessy, DBX4 architect, provides very valuable insight into the DBX4 architecture on his blog.

  • 100% Delphi
  • Delegate Drivers
  • Extensible Command Types
  • Data Explorer Integration
  • Same source for Win32 and .NET
  • Out-of-the-box support for latest versions of most popular RDBMS'es

2. Live Templates

Delphi wiki page contains lots of technical information about Live Templates

Delphi 2006 introduced a feature called "Live Templates" that allows one to write macro type templates that expand from a keyword and are parameterized, i.e. you can tab through the parameters and supply them one by one. This is a great productivity aid. The best part is that you can provide your own and it is relatively simple to do so.

The coolest thing about Live Templates is that their functionality can extended through Open Tools API scriptable engines. Adam Markowitz discusses this features in his blog "Live Template Script Examples - var declaration with initialization and clipboard contents (Delphi2006)".

Nick Hodges, Delphi Product Manager, created "a set of Live Templates and a scripting engine to make development of Blackfish SQL triggers and stored procedure easier". ID: 24990, Nick's Blackfish SQL Development Pack

Marco Cantu says on his blog about scripting live templates:

A nice thing about Live Templates is that they are fully customizable. A not so nice think is that they are not documented. The Delphi Wiki site fills this gap woith two interesting articles, one with lots of examples and the other with some reference material. Now what I'd really like DevCo to document, beside some of the other details, is the list of scripts (or internal functions) you can invoke from the templates, like:

  • InvokeClassCompletion
  • PopulateCase
  • DeclareVariable
  • RemoveTemplate
  • ValidateForTemplate

1. Refactorings

What is Refactoring?

“Refactoring is the process of changing a software system in such a way that it does not alter the external behaviour of the code yet improves its internal structure.”

Martin Fowler, Refactoring

Delphi supports the following refactorings:

  • Rename refactoring
  • Refactor driven “Find References”
  • Introduce Variable refactoring
  • Introduce Field refactoring
  • Inline Variable refactoring
  • Change Parameters refactoring
  • Safe Delete refactoring
  • Push Members Up / Down refactoring
  • Pull Members Up refactoring
  • Extract Superclass refactoring
  • Extract Interface refactoring
  • Move Members refactoring
  • Declare variable refactoring
  • Declare field refactoring
  • Extract method refactoring
  • Find unit/import namespace refactoring
  • Refactor driven “Find in Files”
  • Extract to resource string refactoring

Symbol renaming allows you to change all instances of a symbol's name throughout your project. The Declare Variable and Declare Field options permit you to quickly create a local variable or member field declaration. Resource refactorings are used in Delphi code to convert string literals into resourcestring block entries, replacing the original literal with the resource string symbol. Extract method allows you to select a portion of source code and turn the code into a method, extracting the selected source code. Although not exactly a refactoring, the Import Namespace and Find Unit options under the Refactor menu permit you to quickly locate and import the namespace associated with a particular symbol.

I do not know about you, but for me the support for refactoring is the most useful IDE feature that was not in Delphi 7. This combined with unit testing gives you enormous amount of power and confidence in your code. This is AGILE!

Summary

There is lots of things in Delphi 2007. Every day I'm discovering something new and exciting. If you have not used already, you should definitely give it a try:-)

References

Server Response from: ETNASC03