在将这些 SPROC 替换为在数据库外部实现的 DAL 后,如何复制 SPROC 表依赖关系图?

发布于 2024-08-20 14:35:43 字数 390 浏览 1 评论 0原文

我需要一个适用于拥有数百个应用程序和 SQL 数据库的企业环境的解决方案。当前的体系结构标准要求所有应用程序都使用 SPROC 实现 DAL。原因之一是,当对数据库执行持续迁移、废弃或修改时,这些存储过程和数据库对象之间的依赖关系图(包括对链接服务器上的对象的依赖关系)指示哪些应用程序将受到迁移或删除数据库的影响。

如果要更改架构标准以允许 ORM(例如 LLBLGen、实体框架 v4 等),则不再可能以这种方式生成依赖关系图。

关于如何在 .NET 中实现的 DAL 和 DB 对象之间生成依赖关系图,有什么想法吗?该解决方案需要静态工作(即在运行时不得依赖“监控”数据库访问)。

我可以想象该解决方案可能是特定于产品/技术的,在这种情况下,假设 LLBLGen 用于 DAL,SQL Server 用于数据库。

I need a solution for an enterprise environment with 100s of applications and SQL databases. A current architecture standard requires that all applications implement DALs using SPROCs. One reason for this is that, when performing ongoing migration, obsolescing or modifications to databases, dependency graphs between these SPROCs and database objects (including dependencies to objects on linked servers) indicate what applications will be impacted by migrating or removing a database.

If one were to change the architectural standard to allow ORMs (e.g. LLBLGen, Entity Framework v4, ...), producing dependency graphs this way would not be possible anymore.

Any ideas on how we can produce dependency graphs between DALs implemented in .NET and DB objects? The solution needs to work statically (i.e. mustn't rely on 'mionitoring' db access during runtime).

I can imagine that the solution might be product/technology specific in which case assume LLBLGen for the DAL and SQL Server for the database.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧街凉风 2024-08-27 14:35:44

您可以从 ORM 元数据生成占位符 SPROC,其中包括该特定应用程序使用的所有表/视图/SPROC/函数,然后使用当前工具来分析依赖关系。

You could generate a placeholder SPROC from the ORM metadata that includes all the tables/views/SPROCs/functions used by that particular application and then use the current tools to analyze dependencies.

痴骨ら 2024-08-27 14:35:44

我从 LLBLGen 得到了答案:

从实体到表的依赖关系,你
意思是?你在寻找什么依赖性
究竟是为了?例如,如果您有
400 个表/视图和 30 个实体
映射到它们上面,有很多
未映射的表/视图以及
因此该应用程序不
依赖他们,这就是你吗
后?

这很容易从
模板到你的任何输出
想。使用 .lpt 模板您可以
遍历EntityDefinition
项目对象中的实例和
将它们的目标发送到输出
映射到.这为您提供了一个列表
项目所依赖的目标。这
可以通过命令静态完成
使用命令行生成器。
详细编写请参见SDK
模板。当然你也可以这样做
这在插件中(因为它也有
访问整个对象图)和
例如将其导出到 Excel
通过打开表单并绑定它来插件
到支持导出到的网格
优秀。在 v3 中,这是内置于
设计师,然后您可以查询
使用您想要的任何查询进行项目
(在设计器内部使用 Linq)和
将输出导出到 Excel 或其他
格式。

I got an answer from LLBLGen:

Dependency from entity onto table, you
mean? What dependency are you looking
for exactly? For example, if you have
400 tables / views and 30 entities
mapped onto them, there are a lot of
tables/views which aren't mapped and
therefore the application doesn't
depend on them, is this what you're
after?

This is easy to generate from a
template into whatever output you
want. Using a .lpt template you can
traverse the EntityDefinition
instances in the project object and
emit to the output the target they're
mapped on. This gives you a list of
targets the project depends on. This
can be done statically, on the command
line using the command line generator.
See the SDK for details about writing
templates. Of cource you can also do
this in a plugin (as it also has
access to the entire object graph) and
for example export it to excel in your
plugin by opening a form and bind it
to a grid which supports exporting to
Excel. In v3, this is build into the
designer, you can then query the
project using any query you want
(using Linq, inside the designer) and
export the output to excel or other
formats.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文