What's New in Delphi 2005

What’s New in Delphi 2005?

by Bob Swart (www.drbob42.com)

Bob Swart Training & Consultancy (eBob42)

 

Borland Delphi 2005 Splash Screen

1. Introduction

Borland Delphi 2005 is the latest version of Borland Delphi, offering Rapid Application Development for the Microsoft Windows Operating System and the Microsoft .NET Framework version 1.1. with both the Delphi language (for Win32 and .NET 1.1) and C# (for .NET 1.1 only).

 

Product Overview

Delphi 2005 can be seen as having three different personalities: a Win32 personality using the Delphi language (where Delphi 2005 is the successor of Borland Delphi 7), and two .NET personalities: one using Delphi as language (the successor of Borland Delphi 8 for the Microsoft .NET Framework), and the other using C# as language. With respect to the latter personality, Delphi 2005 is the upgrade from Borland C#Builder 1.0.

As a result, Delphi 2005 is the next step for current Borland Delphi 3 through 8 and Borland C#Builder developers for rapid application development (RAD) on Win32 as well as the .NET Framework.

 

Key Features

[Feel free to suggest others/changes!]

 

- Support for three different personalities: Delphi for Win32, Delphi for .NET and C# all from within one development (and debugging) environment.

 

- Easy migration of Win32 applications to .NET within the same development environment.

 

- Support for the Delphi language with several enhancements like multi-unit namespaces, for ... in ... do loops, inline functions and other code optimisations.

 

- Support for WinForms, ASP.NET Web Forms as well as Borland's own VCL framework on .NET, and VCL for Win32 with visual designers to build applications the RAD way.

 

- Support for heterogeneous database access (using any ADO.NET Data Adapter – not just BdpDataAdapter) as well as multi-tier database applications with new DataSync, DataHub, RemoteServer and RemoteConnection components.

 

- Support for refactoring to restructure your source code, increasing the maintainability and chances of successful reuse.

 

- Support for unit testing with DUnit and NUnit, using the extreme unit-test framework in Delphi for Win32, Delphi for .NET and C# projects to increase the quality of your code.

 

- Support for Enterprise Core Objects II - a UML compliant Object Model Framework and Object Persistence, with support for databases through the Borland Data Provider, and now also available for ASP.NET.

 

- Support for ASP.NET with DB Web controls to facilitate the design, implementation and deployment of powerful data-driven Web applications.

 

- Support for version and team development, with a special backup and history view of your project files, plus optional integration with StarTeam.

 

- Support for integration with J2EE Enterprise JavaBeans (EJB) or CORBA servers with the Janeva solution for Delphi for .NET and C# applications.

 

2. Borland Delphi 2005

This white paper will discuss the major enhancements in Borland Delphi 2005, grouped by area. First, the Integrated Development Environment (IDE) enhancements are covered, followed by refactoring, unit testing with DUnit and NUnit, enhancements in the database and Web areas, ALM support, and finally Delphi compiler, language and debugging enhancements.

 

2.1 IDE

The Delphi 2005 Integrated Development Environment (IDE) is significantly extended and enhanced in nearly every area.

Welcome Page

The Welcome Page is redesigned, showing not only the recent projects, but also the recent news from Borland Developer Network and RSS News feeds (depending on the availability of an internet connection).

Multiple Personalities

Delphi 2005 supports multiple personalities, featuring Delphi for Win32, Delphi for .NET and C# projects. As a little helpful hint, a personality icon in the IDE toolbar displays the active personality (Delphi for Win32 , Delphi for .NET , or C# ).

Project Manager

The Delphi 2005 Project Manager now displays the directory structure of the entire project (and for ASP.NET projects even offers the ability to create and manage subdirectories in your project directory), which offers better insight into where files are placed and which files to deploy. Within a Project Group, we can add projects for different targets (and personalities), and switch from one project to another - and hence one personality to another, instantly.

The Project Manager and the Object Inspector now work together, as you can select a file in the Project Manager, which results in the Object Inspector showing information like the file name and full path, plus file specific properties like the culture, name and version number of assemblies, or the Copy Local option. Most of these properties will be read-only (displayed in grey font), while some can be used to actually change for example the filename or Copy Local status. The Project Manager is also StarTeam aware and offers context sensitive commands within the Project Manager for managing projects stored in StarTeam.

Backup and History

The Borland Delphi 2005 IDE transparently maintains multilevel backups and a history of your project source files in a hidden __history directory of your project directory. This replaces the old .~ files. The __history directory can contain multiple versions of your project (by default the latest 10 versions are maintained), and can be used as a local version control repository.

The History View is used to examine the current and backup versions of your project files, and even view at insightful (and intelligent) difference views between two different versions, showing exactly what you added, removed or modified in your source code. Apart from just looking at the differences, you can also revert changes, going back in time to backup versions of your files.

The History View also supports StarTeam for even more complete team view of your projects history (see ALM section).

Floating VCL Designers

Borland Delphi 2005 now offers a choice of free-floating VCL designers, just like Borland Delphi 7 and prior (as opposed to the fixed form designers of Borland Delphi 8). By default, the Embedded Designer is used, but you can uncheck the Embedded Designer option in the VCL Designer node of the Delphi Options.

 

Delphi 2005 Tools Options dialog

 

This not only allows you to view your form designer and source code at the same time, it also allows you to simultaneously view multiple forms and data modules at design-time.

Sync Edit

Borland Delphi 2005 offers a new Sync Edit feature, which allows you to edit multiple occurrences of symbols in a section of selected code (allowing you to rename them all at once, for example). Note that the Sync Edit feature is lexical, and is therefore best used for small portions of source code (like a routine or method implementation). For renaming identifiers within larger portions of source code, it's recommended to use the refactoring features, which uses a syntactic and semantic engine instead.

 

Delphi 2005 SyncEdit in action

Error Insight

The Borland Delphi 2005 IDE offers a new feature called Error Insight, which highlights syntax errors in Delphi, C# or HTML code as you type. Error Insight will display a red squiggle under the syntax error, including a message with more information about the error. This feature helps you to fix syntax errors in your source code before you even have to start to compile your projects. In addition to undeclared identifiers and misspelled keywords and reserved words, Error Insight also identifies symbols that are not in scope (like a type from a namespace which has to be added to the uses or using clause before it can be used).

Find References

The Borland Delphi 2005 IDE has an enhanced way to find references powered by the new refactoring engine, and use the results to navigate through your source code. You can find local references (within a single source file) of symbols (like fields, methods, properties, variables, etc.), or you can find and examine all references, which will go through all source files of your project.

The references are presented in a treeview, and each node can be used to quickly navigate through your project. If you double-click on a node, the code editor will bring you to the actual line in the source code. This is a very convenient and quick way to access your project files.

 

Delphi 2005 Find References treeview result

 

Find Reference Results are always available via the Views menu, and the treeview can even contain multiple results at once, showing the result of previous searches.

Help Insight

The new Help Insight offers help on symbols like classes, properties, methods or events as you type. Help Insight can show up at two different occasions: either as a tooltip popup, or in combination with a Code Insight popup.

A Help Insight ToolTip window pops-up when moving the mouse in the code editor over a symbol. It produces a tooltip window with information about the specific symbol inside, including relevant links to additional information from the on-line help.

You can also get the Help Insight window in combination with a Code Insight window, in which case the Help Insight gives more information about the currently selected code insight item. This can be very helpful if you need to select a property, method or event but need to know which one should be selected for a specific purpose you have in mind.

 

Delphi 2005 Help Insight on Code Insight

 

Help Insights are also generated from your own classes and methods as well.

Structure View

The upper left corner of the Delphi 2005 IDE contains the Structure View. This window is used in different situations. It can show the hierarchy of source code in the Code Editor, HTML controls in the HTML Designer, as well as the hierarchy of visual controls in the VCL Forms Designer. For a source code structure, the Structure View will also dynamically display syntax errors in the top node called 'Errors', which lists all errors found by Error Insight.

 

Delphi 2005 Structure View

 

When viewing the structure of visual components, you can double-click on items in the Structure View to be taken to the specific component in the Forms Designer. When viewing the structure of source code of HTML, you can double-click on items in the Structure View to be taken to the corresponding declaration in the code editor.

Search Results

When performing searches, the results are now displayed in a convenient treeview, with the hits grouped by filename. You can browse through the files, and open the nodes to view the individual hits inside the specific file.

Tool Palette

The search mechanism of the Tool Palette has been enhanced so that you can now enter the first letter(s) of a component, and immediately only the categories and components that start with this letter(s) are filtered for you, highlighting the letter(s) you typed and filtering further as you type. Pressing enter will place the current selected component on the form in the designer.

Tool Palette Wizards

In addition to showing components (when in design view) or code snippets (when the code editor has the focus), the Tool Palette has been enhanced to also show the wizards from the Object Repository to start new projects, with the Object Repository categories translated into Tool Palette categories. This allows you to easily create new files, projects, and objects from the wizard with a quick hot key.

 

2.2 Refactoring

Refactoring is the process of reshaping existing source code by adding structure to it, without changing the behaviour and output of your code, thereby making it easier for actual reuse and maintenance.

Borland Delphi 2005 refactoring support includes a number of very helpful new features, from extracting methods to declaring new variables or fields, extracting resource strings, renaming identifiers and refining the namespace and uses clauses.

 

Delphi 2005 Refactor Menu

Rename Symbols [Delphi/C#]

While the Sync Edit feature allows you to lexically rename identifiers in a selected section of source code, for larger sections of source code Delphi 2005 refactoring offers the option to rename symbols (like fields, methods, properties, variables, etc.) using Refactor - Rename. The refactoring dialog will even allow you to view all references before refactoring (so you can verify all places where the rename will be made).

This feature adds real refactoring intelligence to the standard search and replace functionality, by not just renaming any symbol within the current scope, but only those that are indeed the same as the selected symbol .For example, if you have both a method X and a local variable X, and you want to rename only the method X, Refactor - Rename ensures the local variable X will be left alone, as it recognizes it’s not the same as the method X).

Declare Variable [Delphi]

While writing source code, it may happen that you use variables before you declare them. The Delphi 2005 refactoring allows you to automatically declare these variables using Refactor - Declare Variable, offering you a dialog to enter the specifics, and adding the variable declaration to the current scope.

This option is only available for variables that are not yet declared, of course, but will allow you to focus on the code and algorithm logic, without having to manually navigate to the beginning of the scope to add a variable declaration. Declare variable works well with Error insights, when an undeclared variable is highlighted by error insights simply right click on the variable to declare.

Declare Field [Delphi]

Similar to declaring undeclared variables, Delphi 2005 Refactoring offers the ability to declare class fields using Refactor - Declare Field. If the field conflicts with an existing field in the same scope, then the Refactoring dialog will allow you to resolve the conflict.

This feature greatly reduces time to extend your classes with fields while writing your source code, without forcing you to return to your class declaration and add the field definition manually.

Extract Method [Delphi]

Delphi 2005 refactoring allows you to select a portion of source code (which might be a portion that is repeated in several places, or could be used in other places), and refactor it by turning the code into a method, extracting the selected source code. The refactored method will automatically get a parameter list as well as local variable declarations, and the original section of source code will be replaced by a call to the newly refactored method. Breaking long sections of code into methods increases maintainability and reusability.

Extract Resource String [Delphi]

There's nothing harder to localise than a portion of source code that uses hard coded quoted strings inside. Delphi 2005 refactoring now allows you to extract these quoted strings and replace them with resource strings (adding the resource string declarations to the implementation section of your code).

Import Namespace [Delphi/C#]

Sometimes you use classes, methods, fields or types that are defined in another namespace. In order to add the corresponding namespace to the uses (for Borland Delphi) or using (for C#) clause, Delphi 2005 refactoring offers the ability to automatically import the required namespace for a selected identifier, using Refactor - Import Namespace.

This feature will save you a lot of time looking up namespaces otherwise.

 

2.3 NUnit/DUnit Testing

Unit testing is a methodology of adding tests to your code in such a way, that the tests themselves can be run and verified by a test project, reporting the continued validity of your source code. For best results, unit testing should be applied right from the start, adding tests to your classes as you write the actual code itself (some people even believe you should write your test first, and then the actual code to test). Unit testing can also play a very helpful role when applying refactoring, if only to verify that the resulting refactored source code is still behaving the same - correct - way.

DUnit/NUnit

A unit testing framework is often called an Xtreme testing framework, related to Xtreme Programming. Delphi 2005 includes both DUnit (for Win32 and .NET) and NUnit. DUnit (http://dunit.sourceforge.net/) is the Delphi version of the unit-testing framework (for both Win32 and .NET), while NUnit (http://www.nunit.org/) is a .NET language neutral unit-testing framework which can be used with both C# and Delphi for .NET.

Both DUnit and NUnit are included and integrated with Delphi 2005.

Test Project Wizard

For every project, you can add an associated test project to the project group using the New Test Project Wizard. For Delphi Win32 projects, this will use the DUnit test framework. For Delphi for .NET projects, you can select either the .NET version of the DUnit test framework, or the NUnit test framework, and finally for C# projects this will use the NUnit test framework. Both the DUnit (for .NET or Win32) and NUnit test frameworks offer a choice of a GUI or console test runner to execute and display the test results.

Test Case Wizard

Within a test project, you can use the New Test Case Wizard to add specific test cases for units that belong to the project. For each unit, you can select the classes and methods of these classes that will be added to the test. An example test skeleton can also be generated so you can later add your own tests manually.

Test Runners

Once a test project with test cases is maintained, there is a separate test-runner environment that you can start from the Delphi 2005 IDE to run the tests, and view the results. You get feedback on all errors and failures (if any), the tests that were not run, and the output written to the console.

Unit testing helps to increase the quality, maintainability and reuse capabilities of your code, and having unit testing integrated into the Delphi 2005 IDE makes it even easier to implement.

 

2.4 Database

Borland Delphi 2005 offers ADO.NET-specific as well as VCL and VCL for .NET database support.

ADO.NET Database Support

A number of database enhancements were implemented in Delphi 2005, particularly in the ADO.NET technology, but also to BDE, dbExpress and the availability of dbGO for ADO on .NET.

Borland Data Provider Enhancements

There are a number of Borland Data Provider for ADO.NET improvements, including support for InterBase Boolean fields, Oracle packages, localized table name support, Schema Name list retrieval, and Sybase 12.5 support.

This brings the list of certified BDP ADO.NET data provider drivers to the following: Borland InterBase 7.5 (should also work but is not certified with InterBase 7.1, 7.0 and 6.5), Oracle 10g (should also work with Oracle 9.2.0 and 9.1.0), IBM DB2 UDB 8.x (should also work with 7.x), Microsoft SQL Server 2000, Microsoft MSDE 2000, Microsoft Access 2000, and Sybase 12.5.

Designer Enhancements

There are significant database related ADO.NET designer enhancements in Delphi 2005. There is new Stored Procedure Testing support, where you can specify the stored procedure to test, including the input parameters, and then actually run the stored procedure and view output parameter values (if any).

 

Delphi 2005 Stored Procedure dialog testing SUB_TOT_BUDGET

 

A special table mapping feature helps you to specify the table mapping for a BdpDataAdapter, where you can specify the mapping between columns of a DataTable and an in-memory DataSet with more descriptive column names. You can also add or remove columns for the in-memory dataset.

The Object Inspector now offers a Connection String Editor for the SQLConnection component, allowing specifying the connection string for an ADO.NET provider.

BDP Remoting, Heterogeneous support

New ADO.NET components called RemoteServer and RemoteConnection offer RAD support for building multi-tier applications (using .NET remoting infrastructure). Two other new ADO.NET components, called DataHub and DataSync, offer support for aggregating heterogeneous databases into single datasets. The four components can be combined, resulting in distributed applications using multiple different ADO.NET data providers. In this architecture, the DataHub and RemoteConnection are part of the thin-client tier, while the RemoteServer and DataSync components are part of the server tier, connected to the data providers.

The AutoUpdate method of the BdpDataAdapter is also enhanced and is now capable of resolving multi-table updates and better error handling.

Data Migration

A special BDP component called bdpCopyTable supports data migration, and enables you to copy tables including data from one BDP supported database to another.

Typed Datasets (.NET)

Typed Datasets now produce code that compile to standalone .NET assemblies. Typed Datasets also support datasets from Web Services. The Project Manager offers context menus to start the Relation and Table Collection Editors for a dataset, so you can modify a typed dataset more conveniently.

Database Explorer enhancements

The Database Explorer, for BDP data providers, has been enhanced in several areas as well. It now supports easy data migration from one BDP data provider to another, with a feature that allows you to copy a table from one BDP data provider, and pasting the table in another BDP data provider. This will copy and reconstruct the table meta data as well as the data to the target database even if the source and target databases are of completely different vendors; from Oracle to MSSQL for example. This corresponds to the behaviour of the BdpCopyTable component.

The Data Explorer offers additional meta data capabilities, and allows you to view and modify the database schema directly from the Data Explorer. You can create new tables, alter tables or drop existing tables.

It's also possible to drag a stored procedure directly from the Data Explorer to a Forms Designer, which will create an instance of the BdpConnection (when needed) and BdpCommand, automatically assigns the stored procedure to the BdpCommand, and populate the parameters for the stored procedure.

 

VCL and VCL.NET Database Support

Delphi 2005 contains database support for VCL and VCL for .NET applications in the form of BDE, dbExpress and dbGo for ADO as well as InterBase Express (IBX). These data access technologies exist for both VCL and VCL for .NET projects, and offer a seamless migration path from Win32 to .NET.

dbGO for ADO

When building VCL for .NET applications, Delphi 2005 now supports dbGO for ADO for both Win32 and .NET, which also makes migration of Win32 dbGO for ADO applications to the .NET Framework possible. The dbGO for ADO components require MDAC 2.8.

dbExpress

The dbExpress components have been extended by a TSimpleDataSet for .NET, better performance for TSQLStoredProc, and meta data improvements.

The following certified drivers are available for dbExpress: Borland InterBase 7.5 (should also work but is not certified with InterBase 7.1, 7.0 and 6.5), Oracle 10g (should also work with Oracle 9.2.0 and 9.1.0), IBM DB2 UDB 8.x (should also work with 7.x), Microsoft SQL Server 2000, IBM Informix 9.x, SQL Anywhere 9 (should also work with ASA 8), MySQL 4.0.x, and Sybase 12.5.

BDE

The Borland Database Engine (BDE) - for VCL or VCL for .NET applications - supports local dBASE and Paradox tables. The BDE for .NET has been enhanced with the ability to dynamically load the BDE DLLs, without the need to specify the path. It also offers increased BLOB performance, and includes some of the BDE components for .NET that were not available before, namely TUpdateSQL, TNestedTable, and TStoredProc.

IBX

InterBase Express (IBX) offers direct connectivity to InterBase for VCL as well as VCL for .NET applications.

2.5 Web

Delphi 2005 contains a number of Web development enhancements both for VCL (for Win32 and .NET) and ASP.NET.

Web Deployment Manager

Delphi 2005 now contains a special Web Deployment Manager, which can be used for ASP.NET Web Form and ASP.NET Web Service projects, as well as IntraWeb for both VCL and VCL for .NET. The Web Deployment Manager can be used to connect to either a directory (local or on a network) or an FTP target. The Deployment View will show both the local files (from the project directory) and the remote files (from the directory or FTP location), and gives you the option to deploy the entire project in one click. You can also compare files, remove files, etc. Deployment settings are stored with your project, so you can always redeploy with your specific settings at a later time. This is very powerful and ideal for fast deployment.

Apart from supporting ASP.NET and IntraWeb projects, the Web Deployment Manager can be extended to support other project types as well.

DB Web Controls

The DB Web controls can be used to build powerful data-driven ASP.NET Web Form applications. Delphi 2005 introduces a number of new DB Web controls, including DBWebAggregateControl, DBWebSound, DBWebVideo, and DBWebNavigationExtender.

The DBWebAggregateControl can be used to display aggregate values of columns from a dataset. Available aggregate operations include Avg, Count, Min, Max, and Sum.

The DBWebSound and DBWebVideo controls are included to support audio and video formats, connecting through a DBWebDataSource to fields from a dataset or from a URL.

The DBWebNavigationExtender is especially helpful in situations where you want to allow updates to be sent to the database, but without using the DBWebNavigation control (specifically the ApplyToServer button of this control). The DBWebNavigationExtender is a non-visual control that can be used to extend standard Web Controls - like a Button - with the functionality of the DBWebNavigator buttons. So you can build your own navigation controls.

Apart from these four new DB Web controls, the DbWebDataSource has been extended with a new OnAutoApplyRequest event, and now supports cascading updates and deletes.

Apart from the DbWebDataSource, DB Web controls can now also connect to an EcoDataSource - which hooks to an ECO II ExpressionHandler.

Delphi 2005 also offers a New DB Web Control wizard that enables you to write your own DB Web compatible ASP.NET control (which can also connect to a DbWebDataSource or EcoDataSource).

The DB Web controls now support XML Caching, which is a powerful feature that can be used as a server-side briefcase for web clients.

DB Web Navigation

Delphi 2005 DB Web controls now have the ability to control the navigation order, using a Navigation API with RegisterNextControl, RegisterPreviousControl, RegisterFirstControl, RegisterLastControl, RegisterInsertControl, RegisterDeleteControl, RegisterUpdateControl, RegisterCancelControl, RegisterUndoControl, RegisterUndoAllControl, RegisterApplyControl, RegisterRefreshControl, and RegisterGoToControl.

Server Controls

ASP.NET HTML controls can now be represented as controls in the code behind file, by using the Run AS Server Control option which adds the runat=server attribute to the scripting control, as well as a control declaration in the code-behind source file.

Template Editors

Delphi 2005 now supports Template Editors for the DataGrid and DataList controls, enabling you to define and easily edit your own custom template columns.

IntraWeb

When using VCL (for Win32 or .NET) Delphi 2005 supports web applications with IntraWeb from AtoZedSoftware (www.atozed.com). IntraWeb offers RAD WYSIWYG design for Web applications, in many aspects like ASP.NET, but also different in certain areas. The main advantage of IntraWeb is its support for transparent user and state management, which ASP.NET doesn’t. IntraWeb Web applications are compatible with non-visual VCL components, like the data-access categories BDE, dbExpress, dbGo for ADO and InterBase Express (which means a migration path from Win32 to .NET) whereas ASP.NET applications use native .NET components with ADO.NET and BDP for data access capabilities.

 

2.6 Enterprise Core Objects II

Borland C#Builder 1.0 and Borland Delphi 8 included the first version of Enterprise Core Objects (ECO), which is greatly enhanced for highly scalable enterprise application development in Delphi 2005. There are several enhancements available in Enterprise Core Objects II compared to the initial version.

The most important ECO II enhancements can be summarized as follows

- support for scalable, distributed applications

- support for ASP.NET (both Web Forms and Web Services)

- support for mapping from existing databases

- overall ease-of-use enhancements to make life in the ECO space easier

Scalable, Distributed Applications

Most importantly, ECO II is now enterprise scalable. Where the first version was a client/server solution, ECO II supports both client/server and remote solutions. There are several possible architectures, out of the box, for building scalable ASP.NET or WinForms applications. Synchronizing multiple object caches i.e. EcoSpaces, either in the same process or in multiple separate processes, is managed by the new extended PersistenceMapper. The synchronizing persistence mapper can in it self be executing within the same process or, more likely, in a process at a server.

 

ECO II and ASP.NET

Using Delphi 2005 we can now combine ECO II and ASP.NET, for use in both ASP.NET Web Forms and ASP.NET Web Services. The Borland DB Web controls can expose objects within an EcoSpace through binding to the new EcoDataSource component, which uses an OCL expression to provide a datasource, and can be used to produce visual data-aware ASP.NET Web Form applications. The same can be done with any regular native ASP.NET Web control. ECO components, such as the ExpressionHandler, provide a list of elements that can be used as a DataSet, and hence binds any ASP.NET components including DataList and DataGrid.

Since requests in ASP.NET applications are stateless, we can maintain the EcoSpace state either in the session or at the application level.

ECO II uses optimistic locking, and when a conflict occurs, conflict resolution is used to determine the correct actions. Specifically, when an Eco Space detects that a value in the actual database is different from the supposed "old value" in the EcoSpace, it registers a conflict in an internal list in the EcoSpace. The developer can call RetrieveChanges for any changes done by other EcoSpaces, and GetChanges for any unresolved conflicts that can then be resolved (usually interactively by the end user).

 

Delphi 2005 ECO II ASP.NET Web Form at design-time

 

Mapping onto Existing Databases

With Enterprise Core Objects II in Delphi 2005 it's now possible to develop applications that use existing databases for persistence, through the new enhanced Object-Relational mapping which is driven by XML schema files. This powerful new feature can be used to reverse an existing MS SQL server, ORACLE or InterBase database, and create the mapping schema file as well as the UML model, with classes wrapping the database tables.

 

Delphi 2005 and Northwind database imported in ECO II Model

 

EcoSpace Designer Enhancements

The EcoSpace Designer has a number of additional capabilities in Delphi 2005, including the ability to generate default mapping schema XML file, to convert an ECO I type database to ECO II format, and to reverse/wrap an existing database. The EcoSpace designer also has been enhanced with new tooltip hints that show a list of the usage tasks need to be done, for example for the PersistenceMapperBdp.

 

Delphi 2005 ECO II design-time tooltip hints

 

The tasks that are done will automatically be checked, so you always have an up-to-date overview of what's done and what steps remains to be done.

In another example where tooltip hints are used: when you want to open a new ECO Package, the hints will show all classes defined in the selected ECO Package.

ECO II Project Targets

Delphi 2005 can now produce several different ECO II projects. For the C# personality, we can create an ECO ASP.NET Web Application, an ECO ASP.NET Web Service, an ECO Package in DLL (so we can use the EcoSpace in another project that uses this DLL), and an ECO WinForms Application. For the Delphi for .NET personality, we can create an ECO ASP.NET Web Application, an ECO ASP.NET Web Service, and an ECO WinForms Application.

 

2.7 ALM

Delphi 2005 integrates with tools from the Borland Application Lifecycle Management suite including CaliberRM, StarTeam, and Janeva.

StarTeam Integration

StarTeam offers support for source code version control, as well as requirements management, defect tracking, threaded discussion groups, and distributed collaboration. Delphi 2005 contains an integrated StarTeam client, available through the StarTeam menu as well as the Project Manager context-menu, which allow you to operate StarTeam from within the Delphi 2005 IDE. You can place projects into StarTeam, check in files, check out files, revert to older versions, lock and unlock files in the StarTeam repository, and more.

Furthermore, the History Manager supports StarTeam so back ups can be accessed and compared or restored from either local backups or the StarTeam repository.

Janeva Integration

Delphi 2005 contains Janeva support (in the Enterprise and Architect editions). Janeva can be used to connect a .NET client application (written in C# or Delphi for .NET) to a J2EE Enterprise JavaBean or CORBA Object. When Janeva is installed (as well as the Janeva IDE plug-in), you get two new menu options for the project node in the Project Manager, Add J2EE Reference... and Add CORBA Reference... to add the specific reference.

The Add J2EE Reference... starts a dialog where you can select an EJB from a .jar file, while the Add CORBA Reference... starts a dialog where you need to select an .idl file that contains the interface definition of the CORBA object. After importing the .jar or .idl file, the result is a native object that can be used by the .NET client, and will go through the Janeva assemblies for a direct connection to the J2EE Enterprise JavaBean or the CORBA object, without the need for additional layers (like a Web Service or gateway software). Previous versions of the Janeva plug-in (for C#Builder) generated C# code, but the Janeva integration in Delphi 2005 generates assemblies that can be used with any .NET language. The Janeva plug-in wizard now automatically generates a corresponding app.config file with the required Janeva parameters for your Janeva client project.

*Janeva requires a runtime license to deploy your application. This is available from your Borland sales representative.

 

2.8 Compiler/Language/Debugging

There are many enhancements to the Delphi compiler, language and debugger of Delphi 2005.

Compiler and Language Enhancements

Several performance enhancements have been implemented for the Delphi 2005 compiler, resulting in even faster compilation speeds. The compiler now also supports Unicode and UTF8 source code files, Unicode characters in identifiers and symbols.

For ... in ... do

The Delphi language has been extended with a new for-loop syntax, a bit similar to the foreach construct. This powerful new language feature can be used to iterate through a set of values.

Function Inlining

Both the Win32 and .NET Delphi languages are extended with function inlining, which can result in faster performance. Instead of calling a routine, the code from the routine itself is expanded in place of the call (saving a call and return, as well as parameter management). This is especially beneficial for small routines, routines outside your unit scope, or routines with many parameters. For bigger routines, the trade-off between efficiency at the cost of bigger code size should be considered carefully before applying inline.

We can either inline routines explicitly with the inline directive, or use an {$INLINE AUTO} compiler directive. The latter will leave it up to the compiler to select routines for inlining that are likely to improve your performance. Using {$INLINE ON} you specify that a set of routines will all be inlined from that point on.

There are a number of exceptions regarding routines that cannot be inlined by the compiler. Although you can inline routines from different units in a package (assembly), you cannot inline routines across package boundaries for example. It's also not possible to inline virtual, dynamic or message methods, as well as methods of interfaces and dispinterfaces.

Multi-Unit Namespaces

The previous version of the Delphi for .NET compiler used a mapping of one unit per namespace (where the name of the unit would be the name of the namespace). This has been expanded in Delphi 2005, where a namespace can now be made up of several units. With a unit name of for example Comp.Group.MyUnit.pas, the left-hand side Comp.Group is the name of the namespace, and MyUnit.pas the local unit scope within the namespace. This allows us to write multiple units and make them all belong to a single namespace (ideal for ASP.NET custom controls, that can now get a single control prefix).

As another consequence of this new namespace feature in Delphi 2005, it's now also possible to use Delphi 2005 in order to extend existing namespaces with our own functionality. For example the System.Web namespace can be extended with classes and types from a System.Web.MyUnit.pas unit. The namespace extension becomes part of any application or assembly that contains the System.Web.MyUnit.pas.

Debugger Enhancements

The Delphi 2005 Win32 debugger now includes better support for Win32 stack frames that do not have debug information. Also included is a special dialog for handling exceptions when debugging within the IDE. When an exception is raised, a dialog will pop-up that offers you the chance to ignore this exception type, or inspect the exception object, including the option to actually Break or Continue.

Breakpoint List

The Breakpoint List has been enhanced with inplace editing, which is most notably for the condition or the group, as well as the enabling of breakpoints which can now be done with checkboxes. This avoids dialogs and speeds up the configuration of our breakpoints.

 

Delphi 2005 Breakpoint List with editable Condition field

 

There is also a new toolbar in the Breakpoint window, which can be used to delete breakpoints, delete all, enable all at once, disable all, or edit the breakpoint properties.

New Debug views

Delphi 2005 contains four new Delphi views. Where Borland Delphi 8 for .NET offered Debug views of Breakpoints, Call Stack, Watches, Threads and the Event Log, Delphi 2005 adds the FPU, Local Variables, CPU and Modules view.

Delphi 2005 now also offers a module view, which displays the App Domains, and allows you to drill down into the details of the namespaces and assemblies loaded within that App Domain. You'll now be able to sort the items in the module view by name or base address.

The CPU view shows the original source code, the IL (Intermediate Language) as well as native machine assembly and opcodes.

 

Delphi 2005 CPU View with mixed Pascal, ILASM and machine code

 

Side-by-Side Debugging

Using the Delphi 2005 IDE it's not only possible to load multiple projects using the Project Manager (in a Project Group), you can also run the Win32 and .NET debuggers side-by-side. Allowing you to run and debug both the Win32 and the .NET application from the same development environment. You can even run both debuggers at the same time, switching from project to project (and personality to personality) in the Project Manager.

 

Summary

This white paper has covered the key new features in Delphi 2005, as well as enhancements to existing technology areas.

As you’ve seen, the IDE has been enhanced with a new welcome page, support for multiple personalities, backup and file history support (with optional integration with StarTeam), floating VCL designers, Sync Edit, Error Insight, Help Insight, a Structure View, Find References, a better way to view search results, and Tool Palette Wizards that help you to start new applications even quicker.

Refactoring is also one of the main new features in Delphi 2005, offering features from Rename Symbols, Declare Variable, Declare Field, Extract Method, and Extract Resource String to Import Namespace.

Another great addition is support for unit testing with DUnit and NUnit, plus IDE integration with Test Project and Test Case wizards.

At the database side, the BDP components have been extended with new drivers, a BdpCopyTable component, DataSync and DataHub components for heterogeneous database support, and RemoteServer plus RemoteConnection components for building multi-tier .NET database applications (using DataSync and DataHub, so even heterogeneous and multi-tier if you wish).

For Web development, the ASP.NET debugging is enhanced, there are new dbWeb controls for aggregate values, audio, video and navigator action events, support for template editors for the DataGrid and DataList, and finally IntraWeb is included for Win32 as well as .NET Web applications.

Enterprise Core Objects (now ECO II) has been enhanced with support for scalable, distributed applications, support for ASP.NET (both regular and dbWeb controls), and the ability to map an existing database in an ECO model.

Delphi 2005 offers integration with Borland ALM tools including StarTeam and Janeva (for connectivity to J2EE and CORBA servers).

Last but not least, the compiler and Delphi language have been enhanced with many new features like the new for..in..do loop, function inlining, multi-unit namespaces. And the debugger has been enhanced with a better breakpoint list, new debug views for .NET, and side-by-side debugging of Win32 and .NET projects.

Best Delphi Ever

Whether your goal is to develop components or applications for the Microsoft Windows Operating System, or for the Microsoft .NET Framework version 1.1, Delphi 2005 offers extensive, high-productivity and high-quality support for modern Windows development.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值