I have a few questions about my database design:
I have this in my assignmnet ( as may be everybody here).
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
So I begin to code my class Data.java :
Data.java implements DB
The read method in DB is pubic
I created 2 read methods in Data
and
[\CODE]
private
String[] readRecord(int recNo)
throws RecordNotFoundException, FileNotFoundException, IOException {
String[] record = new String[nFields];
RandomAccessFile raf = new RandomAccessFile(dbName, "r");
raf.skipBytes(offset);
......
[/CODE]
one public which has the same signature as the one in DB and which call another read ( this one PRIVATE) which is the real one which does the read ( open file, read etc...)
And I have a DataAdaptater which call
I don't understand when they say
data access class
.
Does that mean that the "real" read method ( the one which really does the work) must be public?
I Should I have just one read method in Data ( obviously public to implements the one in DB).
2) Or I could all the public read methods in the adaptater level now called Data ( which implements DB)which methods of an oter class doing the real work?
My question is where do I say implemet DB
1) at the class which is going to daccess the data
2) at the adaptater level ? But I need a class to accesss the data!
and this time it does not implement DB
I am not sure if I am very clear
- Lydie
[ March 18, 2004: Message edited by: lydie prevost ]