安全跨领域关注
我很欣赏安全性被视为一个跨领域的问题,在我当前的开发中,我将安全性构建为一个单独的组件,可供各个层使用。在我的安全组件中,有一个数据访问层用于检索用户、组等。
但是,当在再次拥有自己的数据层的应用程序中使用该数据层时,将其与安全组件一起使用对我来说似乎并不合适。
我有错吗?
I appreciate that Security is seen as a cross-cutting concern and in my current development I have built my security as a seperate component that can be used by my various layers. Within my security component there is a data access layer used to retrieve users, groups etc.
However, having this data layer with the security component just doesn't seem right to me when its used within an application which again has its own data layer.
Have I got this wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想说这种做法没有任何问题。如果您希望确保安全性并且避免因更改公共 DAL 而带来的潜在问题,请将其分开。另外,如果安全表仅由安全组件使用并且没有太多通用业务逻辑,那么将其放在通用 DAL 中并没有给您带来太多帮助。这可能会让它更安全一些——单独的数据连接用于安全检查。
I would say there is nothing wrong with this approach. If you want to keep security secure and free of potential issues introduced by changes to common DAL, keep it separate. Plus if security tables are used only by security component and there is not much common business logic, it does not give you much to have it in a common DAL. It would probably make it a bit safer - separate data connection for security checks.