ArticleslgStudy

computer science

Visual Component Library

Visual Component Library is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Visual Component Library rather than just read about it. In short: The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal.

Key takeaways

  • Visual Component Library belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Visual Component Library to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Visual Component Library from memory before moving on to harder problems.

Reference excerpt

The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal.

History The VCL was developed by Borland for use in, and is tightly integrated with, its Delphi and C++Builder RAD tools. In 1995 Borland released Delphi, its first release of an Object Pascal IDE and language. Up until that point, Borland's Turbo Pascal for DOS and Windows was largely a procedural language, with minimal object-oriented features, and building UI frameworks with the language required using frameworks like Turbo Vision and Object Windows Library. OWL, a similar framework to MFC, required writing code to create UI objects. A key aim of the VCL combined with the Delphi language was to change the requirements of building a user interface. (For context, the Delphi variant of Pascal had a number of innovative object-oriented features, such as properties and runtime type information, inspired by Modula and Smalltalk.) At the time, much UI code work required creating classes inheriting from other classes, and customized objects were often not reusable (for example, a button that performs a specific action cannot be reused in a different application.) UI code was also complicated, forcing the programmer to understand and use the Windows API, manage GDI resources, etc. Finally, a visual user interface arguably should be designed visually, and yet most tools to do so - at the time, mainly Visual Basic - did so in terms of the designer outputting code, creating a fragile, un-manually-editable situation - a problem that still persists today with many UI frameworks, particularly C++-based ones such as Qt. The combination of the Delphi language and the VCL framework written in that language addressed these by:

A streaming framework, allowing an object and subobjects to be streamed to text or binary format - TComponent, the root class of the VCL framework A form designer that saved to a stream, saving the description of the objects not the code required to create them, with objects capable of self-creation when streaming the description back in Language features that allowed instances of a class to be customised without subclassing, in two ways: first, through the use of properties, allowing instances of an object to have its own fields (such as a caption) easily changed through streaming; second, by allowing events - method pointers called at specific places in code - to be handled by another object; that is, the method pointers were attached to an object instance. In other words, this creates "custom behaviours through delegation instead of inheritance". Controls that wrapped native Windows controls, in framework that managed resources The combination of these resulted in a visual designer that streamed a description; a form (window) that constructed itself from that description, including creating all the other components on that form; and code being written in one place (methods on the form) that could be called by UI elements in response to certain actions, such as a button being clicked calling an OnClick event handler implemented in the form code. At the time this was revolutionary, while today it is an approach used by several other frameworks, such as WinForms and Cocoa. This also allowed new components - new visual or non-visual classes - to be written easily. The VCL is Windows-based and its implementations of common controls are wrappers of the Windows API, thus is close to the ground and fully native. New controls can be implemented from scratch or can use existing Windows controls. With the release of C++ Builder, the Delphi compiler could emit C++ header files for compiled Delphi-language units, and so the flexibility of the streaming, visually designed UI framework became available for C++. VCL components can in fact be written in C++, but ultimately inherit from Delphi ancestors, since the C++Builder compiler and linker can consume object and header files produced by Delphi. This was one of the first examples of cross-language compatibility, something unseen until .Net. Today the VCL includes several hundred visual and non-visual components, usable in both the Delphi and C++ languages.

Technology VCL forms a class hierarchy with a common ancestor, the TComponent class (which inherits from TObject, the root class in Delphi Object Pascal). This is a common approach shared by the Java programming language, Smalltalk, C# and many other object-oriented programming languages. VCL components cover Windows controls like windows (TForm class), controls (e.g., TButton, TCheckBox, TLabel classes) as well as database access (e.g., ADO or IBX components) or Internet connections (Indy components). The component approach allows programmers to extend the VCL with many visual and non-visual additional components. There is a large number of free and commercial component packages. Among them are JEDI, TMS, Developer Express, Mitov Software, Raize Software, TurboPower, IOComp, SDL, DA-SOFT Technologies and many others. While not all VCL components are thread-safe, VCL supports multi-threading too. One example is the built in multi-threading support of the OpenWire VCL library. VCL provides native support for PME (properties, methods and events) model at the .NET level. Much of the .NET design, especially WinForms, is modeled after the VCL. One of the main architects of the first Delphi versions, Anders Hejlsberg, was hired by Microsoft and became one of the main architects of .NET. This became the subject of a lawsuit: at the time (1996), "Borland alleged that Microsoft had hired 34 Borland employees over the past 30 months in order to steal Borland trade secrets. Borland also claimed that Microsoft offered and delivered expensive lures to Borland workers. In two cases, incentives topping $1 million were involved." According to Zarko Gajic, the bonus was three million dollars in Anders' case. Many Delphi developers find C# quite familiar, due to the design similarities.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Visual Component Library

Start with the simplest possible case. Write down what Visual Component Library claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Visual Component Library before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Visual Component Library ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Visual Component Library

In research
Visual Component Library appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Visual Component Library in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Visual Component Library is common in secondary-school and first-year university syllabi. It links to neighbouring topics Borland, Component-based software engineering, Computer libraries, so understanding it makes those chapters shorter.
In everyday life
Look for Visual Component Library outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Visual Component Library” →

How to study Visual Component Library in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Visual Component Library means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Visual Component Library out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Visual Component Library in simple terms?

The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal.

Why does Visual Component Library matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Visual Component Library?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Visual Component Library.

Tags

  • Borland
  • Component-based software engineering
  • Computer libraries
  • Pascal (programming language) libraries
  • Software programmed in Pascal

Keep exploring