Lably
Skip to content

Fully qualified name

Unambiguous name in computer code

  • 5 min read
  • 3 chapters

Related on Lably

Through Computer programming, Object (computer science) and Function (computer programming)

Programming

Fully qualified names explicitly refer to namespaces that would otherwise be implicit because of the scope of the call. While always done to eliminate ambiguity, this can mean different things dependent on context.

Commonly encountered applications of the notion have been given their own names, such as the fully qualified domain name and the fully qualified file name.

Examples

To distinguish a fully qualified name from a regular name, C++, Tcl, Perl and Ruby use two colons (::), and Java uses dots (.), as does Visual Basic .NET. and C#. In Java, ActionScript, and other object-oriented languages the use of the dot is known as "dot syntax". Other examples include:

  • As an example of a relational database, in Microsoft SQL Server the fully qualified object name is the one that specifies all four parts: server_name.[database_name].[schema_name].object_name.
  • In Perl, a fully qualified scalar ($scalar) that is in the package package2 would be referred to as $package2::scalar
  • In Ruby, the fully qualified class name is the name of such class with all its parent modules, as Vehicles::Cars::Factory would be the fully qualified name of Factory class within Cars module within Vehicles module.
  • In Rust, the fully qualified type name is the name of such type with all its parent modules, as crate::components::transform::Transform would be the fully qualified name of Transform class within the transform module within the components module of the crate. This can be determined by calling the core::any::type_name function.
  • In COBOL, a fully qualified data item name can be created by suffixing a potentially ambiguous identifier with an IN (or OF) phrase. For example, multiple data item records might contain a member item named ACCOUNT-ID, so specifying ACCOUNT-ID IN CUSTOMER serves to disambiguate a specific ACCOUNT-ID data item, specifically, the one that is a member of the parent CUSTOMER data item. Multiple clauses may be necessary to fully disambiguate a given identifier, for example, ACCOUNT-ID IN CUSTOMER IN LAST-TRANSACTION. This syntax is equivalent to the "dotted" notation employed in many object-oriented programming languages, but with the identifiers specified in reverse order.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in From Lably lessons