We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
每一次请求都要去实例化一个控制器,是不是太奢侈了,作者是不是可以参考一下spring bean的声明周期,或者gin的参考下,每一次请求都去创建一个controller,个人觉得不是太有必要,开发中很少有把状态化数据对象放到controller上,如果有也多半是程序员的不规范,可以选择多种模式,spring的singleton、request或者prototype等多种模式,至少提供一种单例控制器。 好处: (1)减少资源浪费,提升性能 (2)结合市面上的依赖注入全局管理所有controller、service、dao以及其它结构体实例 (3)规范化代码
The text was updated successfully, but these errors were encountered:
No branches or pull requests
每一次请求都要去实例化一个控制器,是不是太奢侈了,作者是不是可以参考一下spring bean的声明周期,或者gin的参考下,每一次请求都去创建一个controller,个人觉得不是太有必要,开发中很少有把状态化数据对象放到controller上,如果有也多半是程序员的不规范,可以选择多种模式,spring的singleton、request或者prototype等多种模式,至少提供一种单例控制器。
好处:
(1)减少资源浪费,提升性能
(2)结合市面上的依赖注入全局管理所有controller、service、dao以及其它结构体实例
(3)规范化代码
The text was updated successfully, but these errors were encountered: