O'Reilly logo

Delphi for .NET Developer’s Guide by Xavier Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Namespaces

Delphi units provide the capability to physically group logical types into separate files. Namespaces take this grouping further by proving a way to hierarchically contain Delphi units. This fits well within the .NET way of doing this because native NET types are already grouped in this manner. The benefits to this are

  • Namespaces can be nested to form a logical hierarchy of types.

  • Namespaces can be used to disambiguate types with the same name.

  • Namespaces can be used to disambiguate units with the same name that reside in different packages.

Namespace Declaration

A project file declares its own default namespace, which we call the project default namespace. Therefore, a project declared as

program MyProject.MyIdeas;

creates the namespace ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required