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

建议:关于 seata-integration-tx-api 下的 GlobalTransactional 注解命名问题 #6951

Open
noear opened this issue Oct 25, 2024 · 4 comments

Comments

@noear
Copy link

noear commented Oct 25, 2024

现有的注解:

  • org.apache.seata.spring.annotation.GlobalLock
  • org.apache.seata.spring.annotation.GlobalTransactional

是不是改为这样更合适?:

  • org.apache.seata.annotation.GlobalLock
  • org.apache.seata.annotation.GlobalTransactional

理由有二:

  1. 这两个注解是在公用模块 seata-integration-tx-api 下面的。带个 spring 不合理。
  2. 如果其它框架适配比较头疼:(用吧?名字带了 spring;;;不用吧,GlobalTransactionalInterceptorHandler 等代码就不能复用了,要 copy 一堆的代码;;;seata v2 要解耦和公共的意图就变弱了)

建议:

  • 保留现有的注解。保持兼容(最好,移到 spring 相关的模块下)
  • 定义新的注解名。内部代码改用新注解;旧注解通过中转保持兼容。
@noear
Copy link
Author

noear commented Oct 25, 2024

@slievrly

@slievrly
Copy link
Member

This is a historical issue, the two annotations were in the spring module in the past, and it obviously made sense when it was in the spring module. With the evolution of technology, abstract out of the transaction mode unified API layer (seata-integration-tx-api module), these two annotations are frequently used by users of the API, in order to be compatible with the lower version of the API, we can not change the package name of the annotation.

@noear
Copy link
Author

noear commented Oct 25, 2024

@slievrly 是不是可以旧的不变(可以考虑移到 spring 的模块下),新增两个中性的注解(同时保持旧的兼容)?。。。

从长久的未来看(10年,20年的长度看),完全是合适的。。。像 dubbo 就有几个相同意义的注解。

@funky-eyes
Copy link
Contributor

alibabadubbo:@Service -> apache dubbo:@Service -> apache dubbo: @DubboService
上面是dubbo针对其service注解变化的过程,实际上GlobalTransactional 这类注解实际上是当时更换包名时忘记修改为中型的包名了,社区在先前有开过会议,当时的结论就是需要将其包名改为中立的名称(在还未捐赠至asf时),我认为应该这么改动,社区先前将tcc等模式的api化支持,也是为了不强依赖spring,所以GlobalTransactional 不应该还放在spring包下

The above outlines the changes to Dubbo's service annotations. In fact, annotations like GlobalTransactional were not updated to the neutral package name during the package renaming process. The community had a meeting previously, and the conclusion was that the package name should be changed to a neutral name (before it was donated to ASF). I believe this change is necessary, as the community previously provided API support for TCC and other modes to avoid strong dependencies on Spring, so GlobalTransactional should not remain in the Spring package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants