I am creating a system to allow a user to add a system file into the database and enable the user to convert this document into different format.
I create three classes,
FileObjectControll(interface)
FileSystemObj(Abstract)
File
because the program is database intensive. So I am always confused whether the add(), delete() function should be in the File class, or within a databasehandler class. Please someone have a look on the design, any comment will be great helpful.
I create three classes,
FileObjectControll(interface)
FileSystemObj(Abstract)
File
because the program is database intensive. So I am always confused whether the add(), delete() function should be in the File class, or within a databasehandler class. Please someone have a look on the design, any comment will be great helpful.
Code:
public interface FileObjectController {
public void convert();
public void secur();
}
public abstract class FileSystemObj {
public int objID;
public String objName;
public String objCreatTime;
public Collection objCollection;
// Add a file into the table
public void add() {
}
public void delete() {
}
// Get a file from the table
public FileSystemObj get(int objID) {
return null;
}
// Get a file collection from the table
public Collection get(String sql) {
return objCollection;
}
}
public class File extends FileSystemObj implements FileObjectController{
public File(int _id, String _name){
super.objID = _id;
super.objName = _name;
}
public void convert() {
// TODO Auto-generated method stub
}
public void secur() {
// TODO Auto-generated method stub
}
}