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

软件架构依赖倒置优化建议 #141

Open
jerry765 opened this issue Dec 6, 2023 · 1 comment
Open

软件架构依赖倒置优化建议 #141

jerry765 opened this issue Dec 6, 2023 · 1 comment

Comments

@jerry765
Copy link

jerry765 commented Dec 6, 2023

首先请允许我分享我所绘制的项目架构图:

架构图

针对项目架构层面依赖倒置原则,项目存在一些潜在的优化点:

  • /api/login/index.ts 文件直接调用 request 方法处理 API 请求,使其他模块高度依赖于具体实现。可定义一个抽象的 API 接口,并使当前文件遵循这一接口
  • /store/modules/permission.ts 文件直接依赖于具体的路由配置。可定义一个抽象的权限接口
  • /router/permissions.ts 文件直接依赖于具体的用户和权限存储实现。可定义一个抽象的权限处理接口

我计划基于这些观点对项目进行针对性的优化。如有不妥之处,还请不吝赐教。

@jerry765 jerry765 changed the title 软件架构优化建议 软件架构依赖倒置优化建议 Dec 7, 2023
@pany-ang
Copy link
Member

pany-ang commented Dec 7, 2023

我最近有事耽搁,后面我会仔细查看你的 PR,非常感谢你的建议!

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

2 participants