RAD Studio (Common)
Programs and Units

This chapter provides a more detailed look at Delphi program organization.

A Delphi program is constructed from source code modules called units. The units are tied together by a special source code module that contains either the program, library, or package header. Each unit is stored in its own file and compiled separately; compiled units are linked to create an application. RAD Studio introduces hierarchical namespaces, giving you even more flexibility in organizing your units. Namespaces and units allow you to
  • Divide large programs into modules that can be edited separately.
  • Create libraries that you can share among programs.
  • Distribute libraries to other developers without making the source code... more 
In Delphi, a unit is the basic container for types. In Delphi, a namespace is a container of Delphi units.
Unlike traditional Delphi units, namespaces can be nested to form a containment hierarchy. Nested namespaces provide a way to organize identifiers and types, and are used to disambiguate types with the same name. Since they are a container for Delphi units, namespaces may also be used to differentiate between units of the same name, that reside in different packages.
For example, the class MyClass in MyNameSpace, is different from the class MyClass in YourNamespace.
The following topics are... more 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!