How to deal with shared objects
One project that I am working for school is a J2EE/Tomcat based document versioning system. As such, it contains objects for directories and documents. The problem that I am having is that these object are really shared objects in that they belong to everyone. As soon as a directory is created, it needs to be available to everyone. If someone then renames that directory, that change needs to be made available to everyone.
The solution that I have found so far is to put the entire directory tree into the application scope and simply give each user a reference to the directory they are using in their session scope. The problem is that as the directory tree grows, I am not sure if this will negatively impact Tomcat. How many objects can Tomcat store in the application scope?
My other solution is to put the directory tree in a cache of some sort and then create references from there.
Problem is that I don’t know which solution is better and I don’t have time to test both. I don’t really like the idea of storing all the object in memory, but I may not have any choice. If anyone has any ideas, please share them and I will update this little problem as I try out my solutions.