由于所有操作名称的长度均为六个字符,因此该问题并不特定于此示例,但需要构想一个可以指定更复杂动词(例如“Get”、“List”或“Find”)的标准。
This is not problematic specifically in this example, since all of the operation names are six characters long, but imagine a standard that specifies more complex verbs like "Get", "List", or "Find".
如果将该字符串设置为无效长度的值,该代码没有问题,但是生成的XML将无法通过验证。
If the string is set to a value with an invalid length, the code is OK, but the XML generated fails validation.
解决这个问题的一个简单方法是创建一个通用散列表,该表提供存储和检索字符串的一种机制。
A simple way around this is to create a general purpose hashtable that provides a mechanism for storing and retrieving strings.
应用推荐