模块化软件中的数据库通信? [英] Database communication in modular software?

查看:111
本文介绍了模块化软件中的数据库通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立具有模块化设计的网络应用程序。



我有整个应用程序的ER数据库模式。
表格根据它们将使用的模块进行分组。
将有核心模块,我计划添加依赖于该核心的新的,即需要核心模块表中的数据。



当NEW模块需要访问核心表,我应该遵循什么实践:



1.为了阅读,




  • a。是否可以从核心表读取或者我需要在核心模块中构建接口

  • b。是具有核心表的JOIN操作良好实践吗?



2.写作目的,


$ b b

  • a。我知道只有良好的做法是使用核心模块接口。


解决方案

p>

如果不从其他模块访问核心表,您将获得更好的模块化。但是你也得到较少的性能,特别是如果你不使用连接。



如果没有特定的需求,我通常不会在模块之间访问表格。类似于模块的数据库,当模块未安装时,它们是单独的或不存在的。


I'm building web app that has modular design.

I have ER database schema for whole app. Tables there are grouped by the module they will be used by. There will be core modules and I plan to add new ones that depend on that core i.e. that need data from core modules tables.

When NEW module needs to access core tables, what practices should I follow:

1.In purpose of reading,

  • a. is it okay to read from core tables or I need to build interfaces in core module?
  • b. is JOIN operation with core tables good practice?

2.In purpose of writing,

  • a. I know that only good practice is using core module interfaces.

解决方案

It depends.

You get better modularity if you don't access core tables from other modules. But you also get less performance, especially if you don't use joins.

I'm normally not dogmatic about not accessing tables across modules, if there isn't a specific requirement making it necessary. Like databases for modules being separate or not existing when modules aren't installed.

这篇关于模块化软件中的数据库通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆