261 reputation
210
bio website ericanastas.com
location San Francisco, CA
age 33
visits member for 4 years, 3 months
seen Dec 8 at 10:19
I write code

Dec
6
comment Distributing a set of “Jobs” across multiple computers
Well yes but my question is how do I coordinate creating the JobSet when the related JobResults are created asynchronously.
Dec
5
asked Distributing a set of “Jobs” across multiple computers
Nov
24
awarded  Notable Question
Oct
31
comment Representing category splits in a personal finance database
Wouldn't this be exactly the same as the second example in my original question then? Not that that is necessarily bad, as I was leaning toward that option.
Oct
30
comment Interface to enumerate over files
Yes but the specifics of how the file is "opened" or "closed" may vary. That's why I'm starting to think an abstract class that defines the overall flow may work better then an interface. The parent class could defined the overall flow and when/if exceptions are thrown or caught. Derived classes would then only need to implement the specifics of how files are opened and saved. Something like this pattern: dofactory.com/net/template-method-design-pattern
Oct
30
comment Interface to enumerate over files
Different enumerators which can access data in different sources.
Oct
30
comment Interface to enumerate over files
So while the enumerator may have multiple files open in the background my intent was that the FileProcessor would only be aware of, accessing, and processing one file at a time. Maybe my that would be more clear if I named these methods "GetNextFile()" and "FinishedWithCurrentFile()" instead?
Oct
30
comment Interface to enumerate over files
No the files would be processed in sequence by FileProcessor. However, in regards to having nested data my thought was the enumerator may keep multiple documents opened in the background. So when the FileProcessor calls OpenNext() the enumerator may open a parent document, and then a child document which it returns first. Then "CloseCurrentFile()" would in reality load the child back into the parent. The next call to OpenNext() would return the parent file to be processed, and then CloseCurrentFile() would close and potentially save the parent file.
Oct
30
comment Interface to enumerate over files
Yes the "enumerator" handles closing and saving. Basically I don't want the processor class to have to worry about where the data came from at all. Maybe it is just a file on a drive. Maybe the data had to be downloaded from an FTP site, or a web service. The caveat that I'm struggling with is the processor does need to know if the enumerator ends up saving the file so that it can include that information in the reported "ProcesssingJobResult".
Oct
30
comment Representing category splits in a personal finance database
Also I don't really understand the purpose of "SplitLineID". This looks like it's used to store the order of the split amounts? I don't think I care about the order though?
Oct
30
awarded  Critic
Oct
30
revised Representing category splits in a personal finance database
Added more columns to example tables
Oct
30
comment Representing category splits in a personal finance database
Thanks for the answer, but the problem I have with this idea is there is other information associated with the transaction that is not split like Date, Tags, Comments, AccountId etc...
Oct
30
asked Representing category splits in a personal finance database
Oct
29
awarded  Commentator
Oct
29
comment Interface to enumerate over files
The overall application I'm developing is a macro/automation tool which may be run on a scheduled with out any direct involvement from a user. So I also want the results of running a "ProcesssJob" on some enumerated set of files to be returned as a single "ProcesssingJobResult" which I can converted into a report, save to a database, saved to a log file etc..
Oct
29
comment Interface to enumerate over files
Part of the problem is acquiring the list of files can be a long process. Each file may need to be downloaded, and opened to find nested contents etc..etc. So I want to do the processing as the files are being iterated over rather then opening them twice. I've added a more elaborate example of my "FileProcessor" code which is consuming my IFileEnumerator
Oct
29
revised Interface to enumerate over files
added 1346 characters in body
Oct
29
comment Interface to enumerate over files
At the moment the method call to run all this looks something like: ProcessResult r = Processor. Run(docEnumerator, processJob); Where processJob is a collection of tasks to perform on each document. Processer reads each document from the enumerator, runs all the tasks, and compiles the results from all the documents into the returned ProcessResult.
Oct
29
comment Interface to enumerate over files
"Document" is a class in a third party API which I do not have control over. Yes I planned to have some implementation(s) of my interface traverse the file/document tree. But I don't want my Processor class to have to worry about this. The Processor class should only have to worry about processing documents one at a time in sequence. Also the status of each Document processed depends in part on the enumerator, as I was going to make read-only enumerators which open but do not save the documents.