首页 > 代码库 > Tapestry IoC Configuration
Tapestry IoC Configuration
Tapestry用来对服务进行配置的方式
对服务进行配置需要用到contribute,然后+serviceId。
看一下代码:
public static void arbitraryMethodName(MappedConfiguration<String,FileServicer> configuration) { configuration.add("doc", new WordFileServicer()); configuration.add("ppt", new PowerPointFileServicer()); }
其中可能最令人不解的就是MappedConfiguration了。
There are three different styles of configurations (with matching contributions):
有三种不同形式的configuration
- Unordered Collection – Contributions are simply added in and order is not important.
- 不排序的集合, 配置简单的追加进去,顺序一点也不重要。
- Configuration<Runnable> configuration
- 不排序的集合, 配置简单的追加进去,顺序一点也不重要。
- Ordered List – Contributions are provided as an ordered list. Contributions must establish the order by giving each contributed object a unique id, by establishing forward and backward dependencies between the values.
- 排序的集合
- OrderedConfiguration<Runnable> configuration
- 排序的集合
- Map – Contributions provide unique keys and corresponding values.
- 映射表
- MappedConfiguration<String,FileServicer> configuration
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。