Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cloud][Project] Capa API adapted to spring annotation. #16

Open
kevinten10 opened this issue Sep 2, 2021 · 4 comments
Open

[Cloud][Project] Capa API adapted to spring annotation. #16

kevinten10 opened this issue Sep 2, 2021 · 4 comments
Labels
cloud sig discussion in discussion help wanted Extra attention is needed

Comments

@kevinten10
Copy link
Member

在和Layotto社区的讨论中,提到了如何适配到Spring注解的问题。
是的,目前Java编程的标准就是Spring,我们哪怕定义一套标准API,也很难去改变Java项目的编码风格。
所以能否将标准API适配到Spring当中(例如注解),这样一来,标准API对于用户是无感知的。

详细的讨论见:mosn/layotto#188

关于此点的讨论如下:

关于做这件事的价值、是否做这件事:我仔细想了下,如果定义一套类似于slf4j的java api spec,最大的问题是:java微服务生态已经被spring 垄断了,spring的编程界面(各种注解)已经是事实意义上的java api spec了,这意味着我们其实是在另起炉灶做同样的事情。比如spring cloud有一个注解,spring-cloud-alibaba、spring-cloud-netflix纷纷来实现它,那么这个注解已经是事实意义上的java api spec。
所以这可能不是个技术问题。是否值得做这件事,做了这件事后咋推广?即使我们定了一套interface,spring cloud的用户最终不会面向我们的interface编程,而是面向spring cloud的编程模型编程,我们只是个对用户透明的中间层,失去了定interface的意义。
这是我的个人观点,先等着看下Dapr社区的意见

@kevinten10 kevinten10 added cloud sig help wanted Extra attention is needed labels Sep 2, 2021
@kevinten10
Copy link
Member Author

@ZakiFan Hi, I know you are doing this work in piggy.

我们是否可以考虑将标准API适配到Spring注解当中呢。例如我们可以从spring-cloud开始。

@kevinten10
Copy link
Member Author

@ZakiFan 这项提案目前还是探索阶段,并不是确定的方向,也许我们可以先进行一定的尝试。

如果你乐意进行这方面的尝试工作,我会将此项assign给你。

关于标准API,我在这里进行了定义:https://github.com/reactivegroup/cloud-runtimes-jvm
也许你可以参考dapr:https://github.com/dapr/java-sdk/tree/master/sdk-springboot
如果你想写一些代码,可以提交到:https://github.com/reactivegroup/capa/tree/master/sdk-springboot

@kevinten10 kevinten10 added the discussion in discussion label Sep 2, 2021
@kevinten10
Copy link
Member Author

@kevinten10
Copy link
Member Author

see mosn/layotto#206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud sig discussion in discussion help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant