Jump to content

Visual Component Library

From Alfawiki
Visual Component Library (VCL)
Company typeSoftware framework
IndustrySoftware development
PredecessorTurbo Vision, Object Windows Library
Founded1995
FounderBorland
FateContinued development and use in Delphi and C++Builder
SuccessorFireMonkey (cross-platform framework)
Area served
Microsoft Windows
Key people
Anders Hejlsberg (principal designer of Delphi language)
ProductsUser interface components for Delphi and C++Builder
OwnerBorland (originally)

The Visual Component Library (VCL) is an object-oriented, component-driven software framework designed for creating user interfaces on Microsoft Windows. It is implemented using Object Pascal.

History

Originating from Borland, the VCL was introduced in 1995 alongside the launch of its Delphi and C++Builder rapid application development environments. Before this innovation, Borland's Turbo Pascal primarily followed a procedural programming style, relying on frameworks such as Turbo Vision or the Object Windows Library to build user interfaces—methods that often involved intricate coding and limited reuse.

The introduction of the VCL and the Delphi language brought forward advanced object-oriented concepts, including properties and runtime type information, which simplified UI programming by providing:

  • A streaming mechanism based on TComponent that serializes objects and their subcomponents into text or binary formats.
  • A form designer that saved descriptions of objects rather than source code, enabling forms to instantiate themselves during streaming.
  • The ability to modify class instances without subclassing through properties and event handlers—method pointers linked to objects—allowing "custom behavior through delegation instead of inheritance."
  • Wrappers for native Windows controls with managed resource handling.

This methodology empowered visual designers to produce forms capable of self-construction from descriptive data, connecting interface elements to event handlers within a consolidated codebase—a pioneering approach that influenced later frameworks such as WinForms and Cocoa.

VCL facilitates the straightforward development of new components, both visual and non-visual, either by encapsulating existing Windows controls or creating them anew. Through C++Builder, Delphi units can generate C++ header files, enabling interoperability across languages and permitting VCL components to be utilized seamlessly in C++ while inheriting from Delphi classes.

Today, the VCL encompasses hundreds of components accessible in both Delphi and C++, maintaining its role as a native Windows-centric UI framework.

Technology

The VCL organizes its classes into a hierarchy rooted in the TComponent class, which itself inherits from TObject—the fundamental class in Delphi's Object Pascal. This design pattern is common among object-oriented languages such as Java programming language, Smalltalk, and C#.

Components within the VCL include standard Windows controls like windows (represented by the TForm class), buttons (TButton), check boxes (TCheckBox), labels (TLabel), as well as components for database connectivity (for example, ADO or IBX) and Internet communication (Indy components). Its component-based architecture allows developers to extend functionality with a wide array of visual and non-visual elements. Prominent commercial and open-source component suites include JEDI, TMS, Developer Express, Mitov Software, and Raize Software.

Although not every VCL component is designed to be thread-safe, the framework does support multithreading, as demonstrated by native multithreading capabilities in libraries such as the VCL-based OpenWire.

VCL inherently supports the PME paradigm at the level of the .NET platform. In fact, much of .NET’s architecture—especially WinForms—is inspired by VCL’s design principles. One of Delphi’s principal designers, Anders Hejlsberg, later joined Microsoft where he became a key contributor to .NET’s development. This transition sparked controversy when Borland accused Microsoft of recruiting 34 Borland engineers over a 30-month span to obtain proprietary knowledge, with some hires reportedly receiving incentives exceeding $1 million. Reports indicate that Hejlsberg himself was awarded a $3 million bonus. Due to these parallels in design, many developers experienced with Delphi find C#’s environment familiar.

Related frameworks

Around 2000–2001, a cross-platform alternative to the VCL known as CLX was created for Delphi, C++Builder, and Kylix, but it was eventually phased out.

A more widely adopted cross-platform framework, FireMonkey, was launched with Delphi and C++Builder XE2 in 2011. FireMonkey is a vector graphics-based UI framework, similar to WPF, that supports Windows, macOS, iOS, and Android platforms.

The Lazarus initiative provides a portable option called the LCL, compatible with Unix-like operating systems, macOS, Win32/64, and Windows CE. This framework was developed independently from both Kylix and FireMonkey.

In a different context, the Visual Class Library (VCL) is a distinct graphics library utilized by OpenOffice.org and LibreOffice.

See also

References