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?
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.