主要问题是,需要保存非常大量的字符串常量。
我希望可以把这些常量管理起来。所以现在是使用大量的内部类管理。
不仅包含大量的内部类。内部类中还包含内部类。不知道这样会不会影响性能问题。
示例:
```
public final class WmsUrlConstants {
public static final String URL_WMS_DEFAULT_INDEX = "/wms/default/index";
public static final class Transfer {
public static final String search = "/wms/transfer/list/search";
public static final String delete = "/wms/transfer/list/delete";
public static final String get = "/wms/transfer/edit/getTransfer";
public static final String submit = "/wms/transfer/edit/submitTransfer";
public static final String save = "/wms/transfer/edit/saveTransfer";
public static final String create = "/wms/transfer/edit/create";
public static final class Package {
public static final String save = "/wms/transfer/edit/savePackage";
public static final String delete = "/wms/transfer/edit/deletePackage";
public static final class Item {
public static final String select = "/wms/transfer/edit/getPackageItems";
}
}
public static final class Product {
public static final class Sku {
public static final String get = "/wms/transfer/edit/getSkuByCode";
}
}
public static final class Store {
public static final String all = "/wms/transfer/edit/getAllWarehouses";
}
}
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.