PruefzifferValidate is a java-tool for validate checksums
(Pruefziffer is the german word for checkdigit). PruefzifferValidate Java Edition
consits of a package with four different classes for validation:
- for german bankaccountnumbers
Banking.class (already implemented)
- for creditcardnumbers
Creditcard.class (planned for version 1.0)
- for international standard book numbers (ISBN)
Isbn.class (planned for version 1.0)
- for electronical article numberings (EAN13)
Ean.class (planned for version 1.0)
The Banking.class uses a textfile with the information of all german banknumbers and
dedicated informations (name and city of location).
The class is highly optimized on use this textfile (for optimisationmechanisms see xxx).
Optimized use of the blz.txt.
The data in the file blz.txt includes all relevant information about german banks
accessible for PruefzifferValidate.
Each line describes one bank. The single data per line are seperated by a semicolon. First
entry is the banknumber followed by the name of the bank, city of the location, a short
identifier (includes name and city) and at last the methodnumber for validate
accountnumbers of this bank.
e.g. 20050550;Hamburger Sparkasse;Hamburg;Haspa Hamburg;0
The file currently comprises nearly 5000 lines.
For developing the Java Edition one of the most important aspects was the minimization of
runtime.
Validate 2000 accounts in a batch-job would cost a lot of time if methodnumber of each
validation must be fetched from the file.
So there are two different batch-modi for minimizate the runtime of a batch-validation.
In the first mode only the banknumbers with corresponding testingmethodnumbers will be
loaded to memory. With a banknumber as index it's very quick to access the needed
testingmethodnumber. But no information about the bank (name, city or shortinfo) are in
the memory. Every ask for them needs a lookup in the file.
In the second mode all bank-information will be loaded to memory, this needs a lot more
space in memory (near 1.5MB) but, no file-reading is needed.
For batch-jobs with more than 100 or 200 accountnumbers to validate it is recommended to
use a batch-mode. If the bankname or bankcity is needed the use of the second batch-mode
is recommended.
Implementing the use of a batch-mode:
It is possible to instantiate a object of the class direct in a batch-mode:
For do so, use the class-constructor with the boolean parameter.
Set the parameter to true, if you want all bank-information to load to memory, else only
the testingmethods will be loaded.
e.g.
Banking pv = new Banking (true);
After instantiating the object can change to a batch-mode by use the method memorizeBankdata(boolean) .
The parameter determines if all bankinformation or the testingmethods only should be
loaded to memory.
|