Readonly architecture constraint

Esben Bach's Avatar

Esben Bach

01 Aug, 2013 12:22 PM

Sometime we have the need to initialise stuff outside the constructor, but ideally we want it to be "readonly" for all but the initialise method (i.e. only that method can change the variable).
This is not possible with the language in itself, but it could be possible with an architecture constraint.

And yes its weird but the Winforms designer system is weird and calls the constructor, so don't blame me! :)

  1. Support Staff 1 Posted by PostSharp Techn... on 05 Aug, 2013 12:34 PM

    PostSharp Technologies's Avatar

    Hi Esben,

    Thanks for the idea. Yes that would be possible. And you should do be able to do it with publically available PostSharp APIs.


  2. System closed this discussion on 13 Apr, 2016 10:33 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac