-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove bad software design: Singleton #883
Comments
I agree regarding the There are a few more singletons: Lines 213 to 214 in c2062e4
But they are mostly wrappers for C-APIs. |
Hi, Line 127 in c2062e4
IMHO: a good goal would be a SeisSol library, which you can use such as
Maybe, we could combine that with python bindings, such as we already have it for the proxy: https://github.com/SeisSol/SeisSol/tree/master/auto_tuning/proxy/src/proxy-runners. |
Yup, that sounds great. If we want to go for a full Python interface, we could also think about compiling all materials etc. into one binary in the long run. That would also bring us really close to multi-material simulations. (I tried to get started on that... Cf. this very WIP branch which tries to go there... https://github.com/SeisSol/SeisSol/tree/davschneller/reduce-defines Right now, it doesn't compile however, since e.g. Currently the initialization procedure iirc only depends on the |
SeisSol makes heavy use of the singleton pattern that I consider bad software design. (In particular the "SeisSol" class.) I believe the singletons where initially introduced due to mess in passing state from C++ and Fortran. Since the Fortran part was finally deleted thanks to @davschneller, I think one should also get rid of the singletons.
Rationale
Singletons have the following disadvantages:
Description
I grepped 172 references to "SeisSol::main". Most of the them are found in Initialization, therefore should be not too hard to remove them.
Discussion
I wonder whether you generally agree that singletons are bad software design and should be removed? If yes, we could start cleaning those up.
Which other singletons are currently present in the code-base?
The text was updated successfully, but these errors were encountered: