What’s New in C++Builder 2006

By: Jason Vokes

Abstract: Read the highlights of the latest features of C++Builder 2006, part of Borland Developer Studio 2006

Table of Contents

What’s New in Borland C++Builder 2006

Introduction

New

Personalities

IDE Enhancements

Personal Developer Productivity

Debugger

History Manager

Build Configurations

Build Events

CodeGuard Integration

Dinkumware Runtime Libraries

Database

Team Productivity

Summary

References

About the Author

What’s New in

Borland C++Builder 2006

Hide image
Click to see full-sized image

    What’s New in Borland C++Builder 2006

    Introduction

Borland C++Builder 2006 provides the upgrade that Borland C++Builder 6 developers have been waiting for several years to receive. Over and above the new specific C++ features, the C++Builder developer will gain significantly from the many capabilities that Delphi developers have enjoyed, incrementally released through the Delphi 7, 8 and 2005. C++Builder 2006 gets all of these improvements in one hit and these collectively add up to an astounding leap forward for C++Builder developers. This paper is not intended to be a definitive work on every new feature, but is intended to provide an introductory look at what makes this release compelling.

    New

C++Builder 2006 is now part of the Borland Developer Studio (BDS) product set; the range of boxed products includes C++Builder 2006, Delphi 2006 and C#Builder 2006 (which are sold separately) even though each one offers the same support for all languages with capabilities varying only according to the edition (Professional, Enterprise and Architect). Here, we are going to focus on the capabilities of C++Builder 2006 Enterprise Edition. Delphi 2006 and C#Builder 2006 offer an Architect Edition also, but the features differentiating the Architect Edition from the Enterprise Edition do not apply to the C++ language personality and so are not covered in this paper.

There are four distinct language “personalities”, as can be seen in Figure 1.

Hide image
Click to see full-sized image

Figure 1: The “Personalities” of Borland Developer Studio 2006

    Personalities

As organisations will already be running a range of software applications and software services it can very often make perfect business sense to reuse existing, well-written and proven systems rather than making the move to “rip and replace” merely for the sake of adopting the latest technology. This is rarely a luxury that organisations can risk or afford. This is where the benefit of BDS 2006 comes into its own, as a mix of the project types shown in Figure 2 would not be uncommon for a multi-faceted business system.

Hide image
Click to see full-sized image

Figure 2: Borland Developer Studio 2006 Project Group Flexibility

As you can see in Figure 2, we have a Win32 C++ DLL that could be providing communication interfacing to some form of device (such as manufacturing, banking equipment or data feed), we have a Delphi Win32 application – in this case a multi-tier DataSnap application – that could interface with the C++ DLL and persist information to a database - and then, to provide Web access, a C# ASP.NET project completes the suite. All of these projects can be developed and managed as a suite of software projects within a single BDS 2006 Project Group.

There are many new levels of features in C++Builder 2006. These range from high level Application Lifecycle Management (ALM) features such tightly integrated team collaboration, change management and version control management, down to low level coding empowerment. Borland have also been keen to express the focus that there has been on delivering performance and responsiveness in this new release and this can be evidenced by the likes of an updated memory manager for the IDE to help support and power some of the new features that are detailed below. Also, IDE start up time has, in general, been improved. Start-up time can be enhanced further by choosing to only install the language personalities that you want to use at any point in time. In fact, it is a simple “–p” command line argument to load just a single personality. For example, “-pCBuilder” would load only the C++Builder personality and such shortcuts are added to the Start Menu as part of BDS installation for each of the personalities.

    IDE Enhancements

Since C++Builder 6, Borland have developed a completely new IDE framework and you will now find yourself working in a very much more intuitive, feature rich and productive environment. Any initial acclimatization will be well worth the investment once you see some of the delights that are in store for you and get the feel of its intuitive nature. To be honest, there are going to be far too many individual improvements and new features to go through in a document of this scope, so let’s give you some of the highlights. As you can see in Figure 3, there is a compelling mix of updated “old favourites”, such as Project Manager, Object Inspector and Structure Pane. Many of these familiar facilities have taken on extra responsibilities and have been mixed with context sensitive content and behaviour throughout.

Hide image
Click to see full-sized image

Figure 3: The New IDE on Startup

Welcome Page

Taking on an idea first implemented in Borland JBuilder, a configurable Welcome Page is now the first thing to greet you on starting the IDE. The default Welcome Page can be seen in Figure 3 with it selectable RSS direct information feeds, resource links and project management buttons. Many development teams choose to customise this Welcome Page with Company or Project specific material and links. The Welcome Page is held under the “Welcomepage” folder of your BDS installation. If you are looking to tailor your Welcome Page, I would recommend that you see the reference section below for more information.

Tool Palette

The new Tool Palette provides a real hub for much of the major action that you are going to see while you are in the IDE. It is much, much more than just a vertical version of the old horizontal Component Palette. There are several very cool things about the Tool Palette.

#1 You can give the Tool Palette the focus (either mouse click or CTRL-P). This enables you to instantly move to it no matter what you are doing or where you are within the IDE.

#2 The Tool Palette is context sensitive. While you are in the designer you get to see components and while you are at Startup or in the code editor, you get to see wizards. For example while you are coding, the Tool Palette would look as in Figure 4.

Hide image
Click to see full-sized image

Figure 4: The Tool Palette with Wizards at Startup

This would mean that if you have a cool piece of code that you would like to place in a class or component of it’s own, you can do this very rapidly using CTRL-P to focus on the Tool Palette and then locate the desired wizard.

Once you return to the designer, the Tool Palette responds to the change in context and would appear as in Figure 5.

Hide image
Click to see full-sized image

Figure 5: The Tool Palette showing Components

#3 The Tool Palette has incremental key searching. You can either click to expand the tab that you would like and then drag/drop a component or a much faster way is to use the incremental key search and home straight in on a component in just a couple of keys. Even when you have hundreds of components installed, you can locate and place any component in a fraction of a second - no more, long, tedious left/right scrolling. Once you have tried this once, you will never look back.

    Personal Developer Productivity

Code Editor

Some of the new features that are the most fun and also provide the best minute-by-minute advantage to the developer are the coding level improvements. Some of the new features are detailed in the following sections.

Code Folding

Sometimes, when coding, it can feel that you can’t see the wood for the trees, especially if you are working with unfamiliar code. This is why the team implemented code folding in the editor. Code folding enables you to condense the source code view in sections leaving a hierarchical view with the first line of a function or code section showing. This gives you a great overview of the overall structure of a piece of code and you can then dive into the detail by expanding the view on sections of code that you want to work on. You can see a “folded” section of code in Figure 6.

Block Completion

When you just know that the IDE could complete your code block with a ‘}’ for your ‘{’. This kind of feature makes for greatly improved coding speed. You will also notice that once braces and brackets have been entered they are “paired” and highlighted in the editor, this can be seen in Figure 6.

Change Bars

Shown in Figure 6, these provide an instant indication of exactly which code lines have been saved and which lines you have inserted or changed since you last saved the file. If neither green or yellow lines are show along the left hand side, then the line has been loaded into the editor and has remained unchanged in that coding session.

Hide image
Click to see full-sized image

Figure 6: Change bars, code folding and

brace pairing - just a few examples of the powerful new code editor.

Refactoring

Refactoring provides the means by which you can automatically change source code with the intent of improving its design rather than changing its behaviour. A refactoring engine was added to the IDE with the introduction of Delphi 2005 and C++Builder 2006 developers now benefit from this addition too. The first refactoring that has been implemented for C++Builder is a “rename” refactoring and can be seen in action in Figure 7.

Hide image
Click to see full-sized image

Figure 7: New “Rename” Refactoring in C++Builder 2006

Live Templates

A significant new addition to Borland Developer Studio 2006 is the new context-sensitive and dynamic Live Template system. This is a worthy replacement for the Code Snippets and Code Templates that Delphi had for some time. (By the way ctrl-J can still be used in-situ to instigate Live Templates) With a wide range of commonly used templates being delivered, you are also free to copy, extend, change or add new templates of your own. Each template is stored in an XML file format in the objrepos\code_templates folder, and then a sub-folder exists for each language type. Templates either execute automatically, or are offered to the developer from within the code editor via the CodeInsights mechanism, as can be seen in Figure 8.

Hide image
Click to see full-sized image

Figure 8: Live Templates Selection

Templates automatically assist the developer in writing commonly used code constructs. Once you choose to execute a template, it does not stop there by just streaming code into the editor. Here comes the “Live” part. During the execution of a template “stop points” provide the developer with the opportunity to work with the template to affect the outcome of the template execution. Active content is based on sub-scripts within the templates xml code.

Surround

When you select a block of code now, you can right click and choose the “surround” option from the speed menu. This provides you with the options as shown in Figure 9. So you can now rapidly add conditionals and loop constructs as your code evolves.

Hide image
Click to see full-sized image

Figure 9: The Surround option and Sync Edit option highlighted

Other Editor Features

There are many other features that will be new for C++Builder developers, some notable additions are block commenting, where you can comment and uncomment whole blocks of selected code using a CTRL + / key combination and also Sync Edit. The Sync Edit icon becomes available when you have a section of code highlighted. You can see the icon highlighted in the bottom left of Figure 9. On clicking this icon, all identical identifiers in the selected code section are highlighted and editing any one of those occurrences will change all the other occurrences instantly. This feature is exceptionally useful for fast multiple changes within local scope rather than having to use search/replace.

    Debugger

The development team have done some great work, focussing on intuitive features that provide the developer with benefits that make every cycle faster and easier. The debugging enhancements include expandable views and more information at every level of debugging inspection. As you can see in Figure 10 there are several ways in which expandable information is available from inline expandable tooltips, expandable local variables and expandable watches. This provides the most convenient way to look directly into data values at the point of concern.

Hide image
Click to see full-sized image

Figure 10: Inline Expanded Tooltips, Local Variables

and Watches while debugging

Some of the other notable new debugging features include enhancements to the way you can work with the detailed CPU view so that you can now select multiple items and copy them to the clipboard.

    History Manager

The History Manager is included in all editions from the Professional upwards, even when you have the advanced version control that comes in Enterprise and Architect editions, this locally-based backup and difference comparison capability makes for valuable insurance against the possibility that you “over-cook” a piece of code.

When you first save a project a sub-folder named “__history” is created. This folder is used to store up to ninety-nine old versions of source code and form files, an example of which is shown in Figure 11.

Hide image

Figure 11: History Manager provides valuable base-line, local versioning, difference comparison and reversion, even for Professional Edition

When (note…not if) you want to use a previous version of a source code unit or form file, you can find the one that you need by using the Diff page within the History tab for the unit. As shown in Figure 12, this provides you with detail on what’s been added and removed between the versions that you choose to compare.

Hide image
Click to see full-sized image

Figure 12: Diff provides a powerful and instant way of comparing changes

    Build Configurations

You can create and quickly switch between multiple build configurations, which store sets of command-line options for build tools - such as the compiler and linker. This new capability enables you to setup and switch between development and release builds or specific debugging and testing build configurations very quickly and easily. There is also the option to copy from one build configuration to another. This makes it very easy to construct different types of development or optimised release builds. You can see the Build Configurations dialog in Figure 13, which is accessed from the main menu Project | Build Configurations.

Hide image

Figure 13: Re-purpose your builds very quickly with Build Configurations

    Build Events

You can specify commands to execute at certain points in the build by right-clicking on a buildable file in the Project Manager and then selecting Build Events. For individual source files, the options are to attach pre-build and post-build events, for executables and DLL’s a pre-link event option is also available. This is an extremely powerful additional configuration to the build process. It means that you are now free to perform most any task that you would like at those points, whether it’s running a pre-parser, executing backup, transfer operations or any other executable you require as part of your build process. Figure 14 shows the Pre-link Event dialog configured to simply load the project file into notepad.

Hide image

Figure 14: Easily embed other processes into your build process

    CodeGuard Integration

CodeGuard is not a new feature to C++Builder developers. In fact, many have relied on it for runtime debugging for their C++ applications for many years now. The good news for C++Builder 2006 is that this capability now has much tighter integration with the IDE. This makes it much easier and faster to deliver high quality C++ software as part of your everyday development. The C++ language is very powerful, but with that power comes responsibility, and it is all too easy to introduce memory type errors that would otherwise not show up in syntactically correct code. CodeGuard provides two principal types of coverage, memory/resource use and function call validation. It is also worth noting that it provides full support for multithreaded applications. For memory and resource use, CodeGuard checks for faulty memory use and improper memory allocation or deallocation, invalid file streams or handles, and resource leaks that can be caused by improper use of file streams or handles. As can be the case with the C++ language, bugs can be down to faulty pointer dereferencing and pointer arithmetic. CodeGuard can be used to verify correct pointer use and will instantly locates nasty and hard to find issues. CodeGuard will also report errors if your program tries to access memory or resources that have already been released. To be honest, no C++ developer should be without it. The comprehensive CodeGuard options are shown in figure15 and can be accessed from the main menu using Project | Options.

Hide image
Click to see full-sized image

Figure 15: No C++ Developer should be without CodeGuard

    Dinkumware Runtime Libraries

C++Builder 2006 now includes the Dinkumware runtime libraries. These provide a large number of functions that conform to ANSI/ISO C++ standards and perform essential services such as input/output, as well as implementations of frequently used operations.

    Database

Persistence is a vital part of almost all commercial software development and Borland Developer Studio 2006 continues to improve the support that Borland developers have enjoyed for major enterprise database servers. Developers are still provided with consistent, fully functional, yet native access to different databases, with the driver support being updated to the following database versions…

Enterprise Database

Name and Version

dbExpress (Win32)

Borland® InterBase® v7.5 and 7.5.1

X

Oracle® 10g

X

Microsoft® SQL Server 2005

X

Informix® 9x

X

IBM DB2® 8.x

X

MySQL® 4.0.24

X

SQL Anywhere® 9

X

Sybase® 12.5

X

Table 1: Database Drivers Available in C++Builder 2006

There is a welcome addition for Win32 developers; dbExpress is fully integrated into the new Database Explorer. This provides full access to view and change data in the tables that you access through dbExpress drivers from within the IDE.

    Team Productivity

With Delphi 2005, Borland introduced industry-leading integration for activities such as configuration management, bug tracking, change management and team discussions. These activities are at the heart of every effective software development team, whether the development team are only in different cubicles, different buildings or even different time zones.

C++Builder 2006 continues this determination to simplify team development by providing enhanced capabilities, as well as extending them into new areas such as Requirements Management.

Change and Configuration Management

Change and Configuration Management client integration and server software has been included in C++Builder 2006. This provides a sophisticated and readily available solution. Just install the server software onto a machine and have your team direct their IDE clients to this for tightly integrated, version control, change management and team collaboration. The client integration is shown in Figure 20.

Hide image
Click to see full-sized image

Figure 20: Change management integration and

server software out of the box.

It’s not uncommon to need to keep track of multiple items in your repository while you are working. You may have two bug reports that relate to the same issue, as well as a discussion thread you’ve been part of where you are discussing the solution. In BDS 2006, the Shortcuts window lets you have a docked pane in the IDE that gives you one-click access to all of these items relevant to your current work.

You also have a Pending Checkins pane that allows you to see at a glance the items you have worked on that have not yet been checked into the repository. Similarly, the Pending Checkouts pane allows you to see the changes that others have made that you have not yet pulled down from the repository. The combination of these two new views makes it extremely simple to keep track of changes that you and other members of the team are making.

Requirements Management

Requirements are the voice of your customer. These are the things that the customer expects to see in the software that you are building. Therefore it is absolutely critical to the success of your project that the voice of your customer be heard across all the people involved in the project.

If you can open a piece of source code and, in addition to the developer comments, you can see the exact customer requirement that the code is attempting to fulfil, along with all the discussions and comments made by other people on the team, then you will have a much better context in which to make decisions.

Hide image
Click to see full-sized image

Figure 21: Borland Developer Studio2006 provides fully integrated requirements management

It is for these reasons that BDS 2006 introduces deeply integrated access to requirements stored in CaliberRM, as you can see in Figure 21 with a Delphi project example. However, this is far from a static, read-only view of the requirements. Developers are empowered to become fully involved in the evolution of the business requirements: you can edit existing requirements, create new ones, take part in online discussions about requirements, and even use drag and drop to create traces between requirements and source code assets.

    Summary

With C++Builder 2006, Borland have focused on two main areas, innovation for software delivery productivity and extending support for application lifecycle management. Although many developers continue to embrace the .NET platform, there are still many organisations that continue to develop Win32 software, especially amongst those using the C++ language with all its specific power for native development.

Borland have been providing extended application lifecycle support for some years now. The developer centric application lifecycle management (ALM) support that now shows greatly increased maturity in this release enables development teams to choose to use ALM in an open and as-needed basis, and not to be forced to use any particular process. This enables developers to optionally hook into backend enterprise development services while at the same time be able to work in ways that best suit both their style and their customers or users.

    References

C++Builder Home Page

http://www.borland.com/us/products/cbuilder/index.html

Borland Community Site C++Builder Page

http://bdn.borland.com/cpp/

Borland Developer Studio 2006 : 24 Hours Home Page

http://community.borland.com/article/0,1410,33368,00.html

Refer to C++ presentations on this page.

Welcome Page Audio Session/Presentation - Daniel Wischnewski

Welcome Page recording

Revisiting the Welcome Page Blog Entry - Steve Trefethen

http://blogs.borland.com/stevet/archive/2004/10/29/1703.aspx

StarTeam Integration White Paper:

http://www.borland.com/resources/en/pdf/white_papers/del_collaborative_teams_wp.pdf

Dinkumware

http://www.dinkumware.com/

    About the Author

Jason Vokes is Borland European Channel/IDE Director and frequently represents Borland internationally as a conference and seminar speaker. Jason is the author of ‘C++ Builder for Dummies’ and has written numerous technical white papers on software development and associated IT topics.

Acknowledgements

Thanks to my friend and esteemed colleague Malcolm Groves (Borland APAC) for allowing me to slice up his contributions to “What’s New in Delphi 2006” white paper and reuse parts here. Cheers Mal.

Server Response from: ETNASC01