Developing Apama Applications > Apama EPL Reference > Lexical Elements > Names
Names
Names are used in EPL programs to refer to the various different kinds of entities in the program. Actions, variables and reference variable members, parameters, monitors, methods, aggregate functions, events, packages, and plug-ins all have names.
Description
Names are either simple or qualified. Simple names consist of a single identifier. Qualified names consist of a sequence of identifiers separated by . symbols.
Every name has a scope, which is the part of a program’s text where the name can be used as a simple identifier. The scope is determined by where in the program the name is declared. See Variable scope.
Do not create EPL structures in the com.apama namespace. This namespace is reserved for future Apama features. If you do inadvertently create an EPL structure in the com.apama namespace, the correlator might not flag it as an error in this release, but it might flag it as an error in a future release.
Name Precedence
When there are duplicate unqualified names for types, the correlator searches for the associated definition in the following order, and uses the first one it finds:
1. The monitor-internal type definitions, for example, event type definitions and custom aggregate function definitions
2. Definitions that have been brought in with a using declaration in the current file
3. Definitions in the current package (this could be the root namespace if a package was omitted)
4. The root namespace
If you try to create a package-level type that has the same name as a definition brought in with a using declaration, it causes a compiler error and the code does not inject. For example:
package foo;
using bar.Bar;
event Bar { // Causes an error when injecting as Bar has already been
           // defined by a "using" declaration.}
You cannot define a type that has the same fully-qualified name as another type.
If two types have the same name but are in different packages, either one can take precedence over the other depending on their ordering in the precedence list. The correlator uses the first match it finds even if that results in an error when a lower-priority match would have worked. For example:
X x;
This causes an error if, for example, there is an aggregate function called X in the current package even if there is an event type called X in the root namespace.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.