Talk:Singleton Pattern

From Free Pascal wiki
Jump to navigationJump to search
  • Reducing the visibility of the constructor

It mentions how changing the visibility of a constructor would break the contract which is, in my opinion, more then questionable since it only changes how an instance is created and not how a created instance is interacted with. And since you can't create a instance with only knowledge about the parent class this argument seams questionable. Rfme (talk) Edit: It might be also worth mentioning that the free pascal standard library itself hides constructors in multiply instances. An example would be the TListItem, which hides the default Create constructor from TObject. Rfme (talk)