- 授权协议: Apache-2.0
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://gitee.com/idela-hp/gadtry
- 软件文档: https://gitee.com/idela-hp/gadtry
软件介绍
Gadtry是一个java工具库集合。包含:ioc, exec(fork进程), graph(图计算)等等常用工具集,并且完全零依赖。
Use
maven
<dependency> <groupId>com.github.harbby</groupId> <artifactId>gadtry</artifactId> <version>1.1.0</version> </dependency>
gradle
compile group: 'com.github.harbby', name: 'gadtry', version: '1.0.0'
Ioc
Create Factory:
IocFactory iocFactory = IocFactory.create(binder -> {
binder.bind(Set.class).by(HashSet.class).withSingle();
binder.bind(HashSet.class).withSingle();
binder.bind(List.class).byCreator(ArrayList::new); //Single object
binder.bind(Object.class, new Object());
binder.bind(Map.class).byCreator(HashMap::new).withSingle(); //Single object
binder.bind(TestInject.class);
});
Set a1 = iocFactory.getInstance(Set.class);
Set a2 = iocFactory.getInstance(Set.class);
Assert.assertEquals(true, a1 == a2); // Single objectClass Inject
public class TestInject
{
@Autowired
private TestInject test;
@Autowired
public TestInject(HashMap set){
System.out.println(set);
}
}Exec New Jvm
Throw the task to the child process
JVMLauncher launcher = JVMLaunchers.newJvm()
.setCallable(() -> {
// this is child process
System.out.println("************ runing your task ***************");
return 1;
})
.addUserjars(Collections.emptyList())
.setXms("16m")
.setXmx("16m")
.setConsole((msg) -> System.out.println(msg))
.build();
VmFuture out = launcher.startAndGet();
Assert.assertEquals(out.get().get().intValue(), 1);
React 进阶之路
徐超 / 清华大学出版社 / 2018-4 / 69.00元
《React进阶之路》详细介绍了React技术栈涉及的主要技术。本书分为基础篇、进阶篇和实战篇三部分。基础篇主要介绍React的基本用法,包括React 16的新特性;进阶篇深入讲解组件state、虚拟DOM、高阶组件等React中的重要概念,同时对初学者容易困惑的知识点做了介绍;实战篇介绍React Router、Redux和MobX 3个React技术栈的重要成员,并通过实战项目讲解这些技术如......一起来看看 《React 进阶之路》 这本书的介绍吧!
