州命名惯例

发布于 2024-12-13 13:22:20 字数 297 浏览 0 评论 0原文

我正在开发一个项目,它有 C# 和 Java 的多个部分(可互操作)。我正在处理文件,最好保留文件的状态。即:哪个部分发生了故障以及故障发生在哪里。另外,如果所有内容都已处理,请将它们标记为已处理。

因为我这个系统有多个组件,大概有5个组件。我希望能够使用命名约定来记录具有状态名称的文件。假设文件 A 启动了组件 1,我想在完成后将其标记为状态 1,我想将其重命名为 A.1.complete 等等。

我想过使用持久性数据库,但它给系统带来了更多的层和更多的依赖。如果我能提出一个模式(命名模式),我将避免数据库层。

你会怎么做?

I am working on a project, it has multiple parts in C# and Java(interoperable). I m working with files and it would be nice to keep states of the files. ie: which part did fail and where if there is a failure. also, if everything is processed mark them as processed.

Because I have multiple components for this system, which is about 5 components. I want to be able to use a naming convention to record the files with state names. Lets say File A started component 1, i want to mark it as being at state 1 once it s complete, i want to rename it as A.1.complete and so forth.

I thought about using a persistence database, but it brings more layer and more dependencies to the system. if i can come up with a schema (naming schema), i will avoid the database layer.

How would you do it?

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

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

发布评论

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

评论(1

橙味迷妹 2024-12-20 13:22:20

为每个状态创建文件夹结构

| 1
|- Inbox
|- Working
|- Complete
| 2
|- Inbox
|- Working
|- Complete
| 3
|- Inbox
|- Working
|- Complete
| 4
|- Inbox
|- Working
|- Complete
| 5
|- Inbox
|- Working
|- Complete

当文件状态更改时,在不同文件夹之间移动文件。
使用文件夹结构而不是命名方案可以更轻松地查找给定状态下存在的项目。只需列出所有文件,而不是尝试解析部分文件名。不会因为您的文件从一开始就具有名称“A.1.txt”而陷入疯狂。

Create a folder structure for each state

| 1
|- Inbox
|- Working
|- Complete
| 2
|- Inbox
|- Working
|- Complete
| 3
|- Inbox
|- Working
|- Complete
| 4
|- Inbox
|- Working
|- Complete
| 5
|- Inbox
|- Working
|- Complete

Move your files between the different folders when they change state.
Having a folder structure instead of a naming scheme makes it easier to find what items that exists in a given state. Just list all files instead of trying to parse parts of filenames. No risk of going bananas just because your file happened to have the name 'A.1.txt' from the beginning.

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