Hi all,
I preferred to post here the answers to some questions Giuseppe have
posted me about the file module he's trying to improve.
He asked me how come the FileFactory implementation doesn't inherits
from BusinessObjectFactory but from DataAccessObject and consequently
needs to implement completely the DAO interface.
Here follows my answer and suggestion for the next upcoming release.
Well, when I first started implementing the file module hibernate
wasn't able to handle lazy properties but only lazy associations.
Obviously it wasn't acceptable to de-serialize a hundred files from
the database (may be gigabytes of data) to simply list a folder
contents, then I decided to move the FileFactory to a file based
repository, storing files into the filesystem instead of the database.
I had to suddenly stop to implement to move on more important modules
like registry and auth, but I still took in mind the problem.
Now hibernate supports lazy properties so the implementation can be
easily moved to database but we still need to take great attention to
store the real file data into a lazy property and well documenting
that accessing that property will implies deserializing a blob object
from the database.
Well, i think I've covered Giuseppe question, but I wish to add
something more. I suggest the upload procedure to allow feedback to
the user thus allowing the development of an AJAX enabled user
interface. To explain: think to what happens when you copy a file from
a directory to another... your OS will display an estimated time of
completion and a progress bar to give you an idea of how the operation
is going proceeding. The same feedback can be providen to users
uploading a file to a remote system (which is an operation not really
different from the file copy previously explained) but to produce this
feedback the underling operation should allow the UI to periodically
ask how much bytes where already transferred, the size of the complete
file.
--
Roberto Lo Giacco
|