Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
hello all, for some time now, I'm trying to solve a design problem. First, I will give you a quick summary of what I want to do (use cases) and then I will propose my solutions (I am not satisfied with). Summary: The big goal is to parse files and put relevant data into a database. The problem is, that there are different kinds of sources coming with different kinds of files: sometimes only a single file, sometimes several files of the same format (same parser for all), sometimes several files and each has a different format, sometimes a zipfile with severel files of the same/ a different format. What I like to do is, to keep most of the program independent of these differences. My "overall" design is a DataExtractor that is independent of these differences and delegates the work to an InputAllocator and a Parser. From the Parser it gets back a DataBlock that is passed to a DataInserter. The InputAllocator: Which solution is best depends greatly on the answer to the question: in what way transforms the Allocator the data and is the returning method for all kinds of source targets the same? As I write this, I realize that my problem is not really to decide between one of the above solutions but to find a way to get the Allocator and the Parser to work in a most general way together. But is that really possible? In case the source is a zipfile or several different files, the parser has to know which file is to parse and how to get it. Or am I in need of some more classes here? most confused, Replies: |
Sponsored Links
|