You should mark init() as private or anyone can use this class isn’t as singleton by mistake
Игорь Никитин
1

Ah, I think I know what you’re referring to. In a lot of cases, it is preferable to make this init() private to control access. In this case, I left off access type to give it “internal” scope, meaning it is visible within the module scope. It is not visible to the sample project or any other consumer outside of the library. That means it is essentially invisible to anyone that adds the lib to their project. However, you point is well taken that another file within the module (in this case framework) could access the init(). So, if someone were to extend the library by adding new classes to it, the init() would be visible to them and hence should be marked private. In this simple case it is OK to leave it with internal scope but it should be marked private if you expect to add more functionality and/or plan to have other developers working on the library project.