码迷,mamicode.com
首页 > 其他好文 > 详细

Tapestry IoC Configuration

时间:2014-06-10 21:08:01      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   code   color   strong   

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

 

 

 

 

 

Tapestry IoC Configuration,布布扣,bubuko.com

Tapestry IoC Configuration

标签:style   class   blog   code   color   strong   

原文地址:http://www.cnblogs.com/voctrals/p/3779496.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!