Distinguir o nome e o espaço de nomes

0

Referência a "namespace", em Namespace - Wikipedia :

In computing, a namespace is a set of symbols that are used to organize objects of various kinds, so that these objects may be referred to by name. Prominent examples include:

  • file systems are namespaces that assign names to files;[1]
  • some programming languages organize their variables and subroutines in namespaces;
  • computer networks and distributed systems assign names to resources, such as computers, printers, websites, (remote) files, etc.

Eu pude compreender a ideia de mencionada por nome e entender name ,

No entanto, eu lutei, mas não consegui distinguir 'namespace' e 'name',
qual é o espaço em 'namespace'?

    
por JawSaw 07.04.2018 / 02:32

2 respostas

2

Espaço aqui é usado em um sentido similar ao conceito matemático do espaço :

In mathematics, a space is a set (sometimes called a universe) with some added structure.

Um namespace é um conjunto de nomes.

    
por 07.04.2018 / 03:06
1

Você também leu o segundo parágrafo da página da Wikipedia ?

Namespaces are commonly structured as hierarchies to allow reuse of names in different contexts.  As an analogy, consider a system of naming of people where each person has a proper name, as well as a family name shared with their relatives.  If the first names of family members are unique only within each family, then each person can be uniquely identified by the combination of first name and family name; there is only one Jane Doe, though there may be many Janes.  Within the namespace of the Doe family, just “Jane” suffices to unambiguously designate this person, while within the “global” namespace of all people, the full name must be used.

Portanto, neste exemplo, "Jane" é um nome e "Doe" é um espaço de nomes.

    
por 07.04.2018 / 04:57

Tags