关于sass:Solon-特性简集相较于-Springboot-有什么区别

46次阅读

共计 19443 个字符,预计需要花费 49 分钟才能阅读完成。

Solon 是一个相似 Springboot 的微型开发框架,也是一个不基于 Servlet 的开发框架。我的项目从 2018 年启动以来,参考过大量前人作品;历时两年,3500 屡次的 commit;内核放弃 0.1m 的身材,超高的 Web 跑分,良好的应用体验。

Solon 强调:克服 + 简洁 + 凋谢的准则;力求:更小、更快、更自在的体验。

所谓更小:

内核 0.1m,最小 Web 开发单位 0.2m(相比 Springboot 我的项目包,小到能够乎略不计了)。

具用户反映,某些我的项目切换到 Solon 后,能够缩减到原来 10% 的包大小。

所谓更快:

本机 helloworld 测试,启动最快可达 0.09s,Qps 可达 12 万之多。可参考:《helloworld_wrk_test》。

所谓更自在:

  • 代码操控自在:
// 除了注入模式之外,还能够按需手动
//
// 手动获取配置
String userName = Solon.cfg().get("user.name");
Properties dbcfg = Solon.cfg().getProp("db");
// 手动获取容器里的 Bean
UserService userService = Aop.get(UserService.class);
// 手动监听 http post 申请
Solon.global().post("/user/update", x-> userService.updateById(x.paramMap())); 
  • 框架抉择自在:

能够用 solon-web 这样的疾速开发集成包。也能够按我的项目须要抉择不同的插件组装,比方:为非 Solon 我的项目增加 solon.boot.jlhttp,0.2m 即可让我的项目实现 http+rpc 开发;还能够用 MVC 开发 Socket 利用。

个性简集:

1、与 Springboot 的罕用注解比拟

Solon 1.2.12

Springboot 2.3.3

阐明

@Inject *

@Autowired

注入 Bean(by type)

@Inject(“name”)

@Qualifier+@Autowired

注入 Bean(by name)

@Inject(“${name}”)

@Value(“${name}”)

注入配置

@Component

@Component

托管组件

@Singleton

@Scope(“singleton”)

单例(Solon 默认是单例)

@Singleton(false)

@Scope(“prototype”)

非单例

@Init *

@PostConstruct

结构实现并注入后的初始化

@Configuration

@Configuration

配置类

@Bean

@Bean

配置组件

@Mapping

@RequestMapping,@GetMapping…

映射

@Param

@RequestParam

申请参数

@Controller

@Controller,@RestController

控制器类

@Service

@Service

服务类

@Dao

@Dao

数据拜访类

  • Solon 的 @Inject 算是:Spring 的 @Value、@Autowired、@Qualifier 三者的联合,但又不齐全等价
  • Solon 托管的 Bean 初始化程序:new() – > @Inject – > @Init
  • 注 1:@Inject 的参数注入,只在 Method@Bean 上无效
  • 注 2:@Inject 的类型注入,只在 @Configuration 类上无效

2、重要的区别,Solon 不是基于 Servlet 的开发框架

  • 与 Springboot 类似的体验,但应用 Context 包装申请上下文。Helloworld 成果如下:
@Controller
public class App{public static void main(String[] args){Solon.start(App.class, args);
    }
    
    @Inject("${app.name}")
    String appName;
  
    @Mapping("/")
    public Object home(Context c, @Param(defaultValue="noear") String name){return  appName + ": Hello" + name;}
} 

3、与 Springboot 类似的事务反对 @Tran

  • 采纳 Springboot 雷同的事件流传机制及隔离级别
@Controller
public class DemoController{
    @Db
    BaseMapper<UserModel> userService;
    
    @Tran
    @Mapping("/user/update")
    public void udpUser(long user_id, UserModel user){userService.updateById(user);
    }
} 

4、与 Springboot 不同的较验计划 @Valid

  • Solon 的计划更偏重较验参数(及批量较验),且强调可见性(即与处理函数在一起)
@Valid  
@Controller
public class DemoController {

    @NoRepeatSubmit
    @NotNull({"name", "icon", "mobile"})
    @Mapping("/valid")
    public String test(String name, String icon, @Pattern("13d{9}") String mobile) {return "OK";}

    @Whitelist
    @Mapping("/valid/test2")
    public String test2() {return "OK";}
} 

5、基于标签治理的缓存反对 @Cache,与 Springboot 略有不同

  • 基于标签治理,防止不必要的 KEY 抵触
@Controller
public class DemoController{
    @Db
    BaseMapper<UserModel> userService;
    
    @CacheRemove(tags = "user_${user_id}")
    @Mapping("/user/update")
    public void udpUser(int user_id, UserModel user){userService.updateById(user);
    }
    
    @Cache(tags = "user_${user_id}")
    public UserModel getUser(int user_id){return userService.selectById(user_id);
    }
} 

6、具备语义个性的 Bean 定义,实 https://github.com/hitl837/ml…

https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…
https://github.com/hitl837/ml…
https://www.github.com/hitl83…
http://github.com/hitl837/mlo…

正文完
 0