Talk:Private class data pattern
From Wikipedia, the free encyclopedia
[edit] Possible copyright violation
HTML embended in wikicode of this article indicates that article text has been looted from some web page. Googling resulted in just one hit: http://www.novell.com/coolsolutions/feature/11292.html
The strange thing is that the article at wikipedia is older (11 December 2004) then Novel's (18 January 2005). --Alvin-cs | Talk 9 July 2005 13:52 (UTC)
[edit] Copyedit progress
I replaced the (potentially) copyrighted sample code with a better example and organized the article according to the standard Gang of Four (software) documentation structure. There are some missing sections, so I won't remove the copyedit tag yet, but it looks close. The Rod 21:00, 15 November 2005 (UTC)
(Forgot to sign above. Signed now.) I removed the copyedit tag since this article still has a stub tag. The Rod 21:00, 15 November 2005 (UTC)
[edit] C# And readonly
"Although marking attributes of classes as const (or final or ReadOnly in other programming languages) restricts their manipulation, the attributes above are set in the constructor and hence cannot be marked as such."
AFAIK The above is untrue for C# (maybe all .NET?) as the readonly field modifier additionally to initialization allows assignment in constructor bodies and forbids any other assignment. Hence, using the pattern in C# is unnecessary.
- NB the readonly keyword prevents assignment, but does not prevent modification using the variable's methods (unlike C++'s const). 202.89.151.20 08:48, 11 September 2007 (UTC)
- This pattern doesn't solve that issue. The references to the objects in the 'private data object' are still accessible to the methods of the Circle class. They are also accessible to the method that created the instance of Circle. This pattern is rather pointless. Dubwai 13:39, 22 October 2007 (UTC)