A
arieljake
I am creating a program that will be handling files from potentially
numerous sources. I will be extending a base Parser class for each
possible source of data to extract data in a manner specific to the
format of the File. Along with a parse(File) function, the Parser
objects will also have a canParse(File) function.
What I am looking for is to build a framework that will allow me to
update the overall program by adding new sub-classes of Parser with
ease. The Parser objects once created will not change much. Just the
number of Parser object to be considered for parsing data.
How can I "register" these Parser modules so that the appropriate
Parser class can be requested to parse my data?
Possible options I have thought of: a database with fields to be
queried, a properties file, neural networks (though I don't know how
yet), or simply a ton of if/else statements.
Given certain characteristics and "header" attributes of the File, how
can I efficiently determine the best Parser class to handle my data?
thank you,
Ariel
numerous sources. I will be extending a base Parser class for each
possible source of data to extract data in a manner specific to the
format of the File. Along with a parse(File) function, the Parser
objects will also have a canParse(File) function.
What I am looking for is to build a framework that will allow me to
update the overall program by adding new sub-classes of Parser with
ease. The Parser objects once created will not change much. Just the
number of Parser object to be considered for parsing data.
How can I "register" these Parser modules so that the appropriate
Parser class can be requested to parse my data?
Possible options I have thought of: a database with fields to be
queried, a properties file, neural networks (though I don't know how
yet), or simply a ton of if/else statements.
Given certain characteristics and "header" attributes of the File, how
can I efficiently determine the best Parser class to handle my data?
thank you,
Ariel