Menu

#11 Constructors don't honor private-ness

open
nobody
None
5
2013-01-17
2012-01-02
Ron Fox
No

If this has been added to an version since 3.4 my apologies for posting this.
There are software patterns such as singleton, where it is useful to be able to declare a constructor as private to control how the class is instantiated.
While one can declare a constructor as private, the dispatcher does not honor this allowing non class methods to construct an object. It would be useful to add enforcement of visibility for constructors.

Thanks,

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.