Understanding routine name, method name, and method ID
Whether you load data from an XML file or use the MDU to populate the SMC, you will be dealing with the routine name, method name, and perhaps method ID. This topic explains the roles of these three identifiers and offers some suggestions on how best to use them depending with the different xfNetLink clients.
The routine name is simply the name of your Synergy subroutine or function.
The method name is a 50-character value that you create to reference the Synergy routine. It is used by xfNetLink Java and xfNetLink .NET to invoke the Synergy routine within your client code. (xfNetLink Synergy uses the method ID instead; see below.) Methods are grouped into interfaces for inclusion in a Synergy component; consequently, the method name must be unique within an interface. When you generate a JAR file or assembly, the interface name becomes the class name, and the method name becomes the name of the generated method within that class.
The method ID is a unique, 31-character value that is used to identify the Synergy routine. xfServerPlus uses this value to look up the routine to call in the SMC; consequently, the method ID must be unique within the method catalog. By default, the method ID is generated from the method name. (This is the case both when entering data directly in the MDU and when using attributes to define your methods.) Keep in mind that while the method name may be up to 50 characters long, the method ID is limited to 31 characters. If the method name is longer than 31 characters, it will be truncated when it is copied to the method ID. You can change the generated method ID if desired.
The method ID is used in different ways depending on the client:
- The XFPL_REGCLEANUP routine requires that you pass the method ID of your cleanup method.
- Users of xfNetLink Java do not directly reference the method ID in the client code, but Java connection pooling requires that you reference the method ID in the pooling properties file.
- Users of xfNetLink .NET never directly reference the method ID in the client code.
- Users of xfNetLink Synergy reference the method ID—not the method name—in the client code to invoke the associated Synergy routine. Although it might seem simplest to use the routine name as the method ID, there are advantages to using a different value for the method ID. For example, if your client program needs to call the same routine in different ways, you can define it multiple times in the SMC, each with a different method ID. Or, if the Synergy routine name is cryptic, you can use a longer and more meaningful name as the method ID.
If you are using the MDU to enter data, it will copy the value you enter in the Method name field to the Method ID field. Method name is a required field, so for xfNetLink Synergy users we recommend that you enter the value you want to use for the method ID into the Method name field, keeping in mind that while method name can be 50 characters, method ID can be only 31.