RAD Studio (Common)
ContentsIndex
PreviousUpNext
Programs and Units

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

Name 
Description 
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. Microsoft's Common Language Runtime (CLR) introduces another layer of organization called a namespace. In the .NET Framework, a namespace is a conceptual container of types. In Delphi, a namespace is a container of Delphi units. The addition of namespaces gives Delphi the ability to access and extend classes in the .NET Framework.
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... more 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!