Hi all,

as I’m digging into IoTDB more and more, I noticed a quite excessive usage of 
the Singleton pattern … some times even for things where it doesn’t really make 
much sense. For example in SystemFileFactory, the methods don’t really have 
much state and simply fire RuntimeExceptions if fsType is initialized with HDFS.

Singletons make it a bit tricky to run tests in parallel and to do dynamic 
reloading of modules (like in OSGI). Most projects I’ve worked on try to limit 
the use of singletons to an absolute minimum due to these problems.

I guess embedding IoTDB in an OSGI environment hasn’t been a use-case yet, but 
I could imagine that random test failures while running tests in parallel 
probably could have caused some issues.

Was this a design decision that is based on some real-world necessity, or for 
simplifying things during development?
I don’t want to put too much effort into proposing cleaning up things, if there 
was a conscious decision to do things otherwise.

Chris

Reply via email to