Aaah cool, and sorry for asking so much … much of IoTDBs history is not recorded and I’m just starting to get my hands dirty. I am afraid, that I’ll probably have more questions like this as they come up.
But that means, if I see something that can be refactored quickly, I can create PRs for stuff like that? Just asking, cause I like to do simple maintenance tasks in order to think about other problems. In PLC4X I usually did cleanups regularly for such reasons. Chris Von: Yuan Tian <[email protected]> Datum: Freitag, 14. Juli 2023 um 13:58 An: [email protected] <[email protected]> Betreff: Re: Usage of Singleton pattern? Hi Chris, Actually, most of the existing Singleton pattern Class is just for simplifying things during development. And we did run into trouble when writing some UTs(In such case, I will change related Singleton pattern Class ). But there are always higher priority tasks, so there is no time to change all these singletons. Good news is that we have strictly controlled the use of singletons in the new PRs, so there should be no more new ones. Best, ---------------- Yuan Tian On Fri, Jul 14, 2023 at 7:14 PM Christofer Dutz <[email protected]> wrote: > > 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 >
