R
R
Hi All,
I have written simple application connecting to DB, I've chosen DAO
pattern as suggested
on
http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html.
So I have created classes:
DAOFactory - abstract, creates vendor specific DAOFactories,
getDAOFactory is public static
ApacheDerbyDAOFactory - extends DAOFactory - implements getContactDAO,
vendor specific, has createConnection() method
ApacheDerbyContactDAO - implements ContactDAO interface, vendor
specific
ContactDAO - interface, contains: create, findAll, delete, update
methods
Contact - business class for representing addresses, names, icq etc.
how should I put them into packages?
db.interfaces
db.implementations
busisness
are there any best practices?
thanks in advance
best regards
R
BTW
I'm using embedded Apache Derby 10.1.1
It creates DB in current directory although I have created
derby.system.home property:
String userHomeDir = System.getProperty("user.home", ".") +
System.getProperty("file.separator");
String systemDir = userHomeDir + ".embedded_derby";
// Set the db system directory.
System.setProperty("derby.system.home", systemDir);
any idea what's wrong with it? systemDir and derby.system.home property
are correct...
I have written simple application connecting to DB, I've chosen DAO
pattern as suggested
on
http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html.
So I have created classes:
DAOFactory - abstract, creates vendor specific DAOFactories,
getDAOFactory is public static
ApacheDerbyDAOFactory - extends DAOFactory - implements getContactDAO,
vendor specific, has createConnection() method
ApacheDerbyContactDAO - implements ContactDAO interface, vendor
specific
ContactDAO - interface, contains: create, findAll, delete, update
methods
Contact - business class for representing addresses, names, icq etc.
how should I put them into packages?
db.interfaces
db.implementations
busisness
are there any best practices?
thanks in advance
best regards
R
BTW
I'm using embedded Apache Derby 10.1.1
It creates DB in current directory although I have created
derby.system.home property:
String userHomeDir = System.getProperty("user.home", ".") +
System.getProperty("file.separator");
String systemDir = userHomeDir + ".embedded_derby";
// Set the db system directory.
System.setProperty("derby.system.home", systemDir);
any idea what's wrong with it? systemDir and derby.system.home property
are correct...