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

reconstruction the getty module #533

Open
georgehao opened this issue Mar 31, 2023 · 4 comments
Open

reconstruction the getty module #533

georgehao opened this issue Mar 31, 2023 · 4 comments
Assignees
Labels

Comments

@georgehao
Copy link
Contributor

What would you like to be added:

Why is this needed:

@georgehao georgehao self-assigned this Mar 31, 2023
@iSuperCoder
Copy link
Contributor

@georgehao
你是基于什么原因想要重构getty模块的?我这里也发现了getty模块的一点问题,可能需要重构来解决。

问题如下:
getty模块所依赖的getty.Session接口中,定义了小写开头的私有方法。这导致我们无法在seata-go中对Session接口进行mock,不方便单元测试,影响测试覆盖率。

@Issues-translate-bot
Copy link

RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@georgehao
What is your reason for wanting to refactor the getty module? I also found a little problem with the getty module here, which may need to be refactored to solve it.

Questions are as follows:
In the getty.Session interface on which the getty module depends, private methods starting with lowercase are defined. This makes it impossible for us to mock the Session interface in seata-go, which is inconvenient for unit testing and affects test coverage.

@georgehao
Copy link
Contributor Author

getty 到处都是用的单例模式,这点不太能接受。模块跟模块之间的联系表达的不清晰

@Issues-translate-bot
Copy link

RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The singleton pattern used everywhere in getty is not acceptable. The relationship between modules and modules is not clearly expressed

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

No branches or pull requests

4 participants