I don\'t know if there is a spe开发者_如何转开发cific name for this, but I am designing an application backed by a database in which rows need to be immutable (not sure if that term applies here, but
I am writing a function that returns a reference to an object of some encapsulated data structure and I want nobody to be able to change the object using that reference, is it possibl开发者_运维百科e
I\'ve been rea开发者_开发知识库ding a bit about immutable structures such as string. Simply put, they don\'t change state once they\'ve been created (so for instance asking for a substring gives you a
Some background: I am writing a generic high-level to low-level compiler.On the high-level side, it understands classes, methods, fields, virtual method calls, etc. and on the low-level side, it under
Once 开发者_StackOverflowI studied about the advantage of a string being immutable because of something to improve performace in memory.
I am trying to convert a mutable class to an Immutable class following the advices given in Effective Java Item 15 (Minimize Mutability). Can anybody tell me whether the class I created is
What is the reason why Wrapper classes (like Integer, Double, etc.) don\'t ha开发者_运维百科ve a setter for their inner primitive value ?
I want to have an Object with immutable fields in Objective-C. In C#, I would use Properties with private setters and a big constructor.
A familiar problem using VisualStudio is the mysterious calling of property getters. If these have side effects (the most common being of the form if (foo == null) foo = new foo(); return foo; ), then
I asked myself this question a couple of times and came up with a solution for that feels very dirty. Maybe you can give me any advice since I think this is a basic problem for every DSL written in Sc