Solon 1.6.15 發布,增加部分jdk17特性支援
關於官網
千呼萬喚始出來: //solon.noear.org 。整了一個月多了。。。還得不斷接著整!
關於 Solon
Solon 是一個輕量級應用開發框架。支援 Web、Data、Job、Remoting、Cloud 等任何開發場景。短小而精悍!
- 強調,克制 + 簡潔 + 開放的原則
- 力求,更小、更快、更自由的體驗
目前已有近130個生態插件,含蓋了日常開發的各種需求。
關於 Solon Cloud
Solon Cloud 定義了一系列分散式開發的介面標準和配置規範,相當於DDD模式里的防腐層概念。是 Solon 的微服務架構模式開發解決方案。
本次主要更新
- 增加對 kotlin data class 和 jdk14+ record 的序列化、反序列化及注入支援
public record User(String username, Integer age) { }
@Controller
public class DemoController{
@Mapping("/test")
public void test(User user){
}
}
- @Service 增加 name, typed 屬性
//通過 name 指定 bean name;通過 typed 註冊類型 bean,即 DemoService 的默認實現
@Service(name="DemoService-CN", typed=true)
public class DemoServiceCnImpl implements DemoService{
}
//上面這種方式需要「編譯時」確定默認bean(註:當沒有name時,都是默認bean)
//
//基於Solon的特性,還有一種「運行時」確定的方案
//
@Service(name="DemoService-CN")
public class DemoServiceCnImpl implements DemoService{
public DemoServiceCnImpl(){
if("CN".equals(Solon.cfg().get("datacenter.region", "CN"))){
Aop.wrapAndPut(DemoService.class, this);
}
}
}
- 優化 sqltoy-solon-plugin 插件,增加便利的多數據源控制和切換
@Service
public class DemoService{
@Db
SqlToyLazyDao dao1;
@Db("db2")
SqlToyLazyDao dao2;
}
- 新增 solon.extend.async 插件
@Service
public class AsyncTask {
//會被非同步運行(提交到非同步執行器運行)//不要有返回值(返回也拿不到)
@Async
public void test(String hint){
System.out.println(Thread.currentThread().getName());
}
}
- 修復 當主應用配置有變數時,應用環境配置無法替換的問題
- 優化 Aop.beanForeach ,進行去重處理
- 增加 三種日期格式自動解析
快速了解 Solon
項目地址
- Gitee://gitee.com/noear/solon
- Github://github.com/noear/solon