下面是它使用的Multiton: * A classic Multiton making use of lambdas to delay the create..public class Multiton<K extends Multiton.Creator> {
* The storage.}
}
public static void main(String args[])
我在MVC应用程序中有一个Singleton模型类来确定用户登录是否具有授权/管理(基于某些AD组的成员资格)。这个模型类需要是Singleton,这样用户的访问权限可以在第一次登录时建立并在整个会话中使用:{ // from http://csharpindepth.com/articles/general/singleton.aspx#lazy
public static ApplicationUser CurrentUser { get
在Kodein中,我有以下绑定 bind<AppDependent>() with multiton {
title: String -> AppDependent(titleappDependent: AppDependent by instance(arg = "My Text") 但是,如果我的绑定有多个参数,例如 bind<AppDependent>() with multiton