数据库中接口元数据的优点

发布于 2024-08-20 07:15:38 字数 241 浏览 4 评论 0原文

我正在开发一个应用程序,其中接口元数据存储在数据库中。

基本上,C# .NET 应用程序从 SQL Server 表中读取按钮、标签、单选按钮等的位置、大小和文本。

据我所知,编写该应用程序的人手动输入了所有这些信息,因为我找不到用于执行此操作的工具(或工具的任何提示)。

无论如何,我发现在没有某种工具的情况下维护这些信息相当乏味,我想知道与简单地使用 Visual Studio 界面设计器相比,这种安排有什么优势?

I'm working on an application where the interface metadata is stored in a database.

Basically the C# .NET application reads the positions, size and text of buttons, labels, radiobuttons, etc.. from SQL Server tables.

As far as I can tell, who ever wrote the application entered all of this information by hand as I cannot find the tool (or any hints of a tool) used to do this.

At any rate, I find it rather tedious maintaining this information without some sort of tool, and I'm wondering what the advantages are of such an arrangement, as opposed to simply using the Visual Studio interface designer?

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

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

发布评论

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

评论(2

左秋 2024-08-27 07:15:38

也许这只是实现 INI 文件的不同方式?

没有什么能真正阻止你这样做,尽管这样做可能是有原因的。也许由于某种原因导致文件无法写入本地硬盘或注册表中存储的密钥。

Maybe it's just a different way of implementing an INI file?

There's nothing really stopping you from doing it this way, though there may have been a reason why it was done that way. Perhaps there was some reason why files couldn't be written to the local hard drive or keys stored in the registry.

人海汹涌 2024-08-27 07:15:38

我想如果您希望能够在不重新编译的情况下修改这些内容,这将是一个优势。它还可以让您避免分叉源代码,然后必须维护两个变体。也许开发人员正在考虑国际化,这肯定会影响标签,并且也可能(因此)影响尺寸和位置。原则上,您只需更换新的表格内容即可为不同的语言做好准备。

我可以看到为每个字段而不是每个控件保留 UI 元数据,以确保该字段在整个界面中一致呈现(相同的标签、格式,甚至控件,例如单选按钮与下拉列表) )。如果您需要更改 8 个不同窗口中使用的字段的标签,那么您只需在一处修复它。

I guess it would be an advantage if you wanted to be able to modify those things without re-compiling. It may also allow you to avoid forking the source and then having to maintain both variants. Maybe the developer was thinking about internationalization, which certainly affects labels and may also (as a consequence) affect size and position too. In principle, you just need to swap in new table contents you're ready for a different language.

I can see keeping UI metadata for each field as opposed to each control in order to ensure that the field is presented consistently throughout an interface (same label, format, even control, e.g., radio button versus dropdown list). If you need to change the label for a field used in 8 different windows, then you only have to fix it in one place.

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