immutability
How to avoid "too many parameters" problem in API design?
I have this API function: public ResultEnum DoSomeAction(string a, string b, DateTime c, OtherEnum d,[详细]
2023-03-10 05:09 分类:问答Google Collections (Guava Libraries): ImmutableSet/List/Map and Filtering
Assume that you want to build a copy of an ImmutableSet/List/Map obje开发者_运维知识库ct but filter out some of the original entries. One way to implement that is the following:[详细]
2023-03-09 12:34 分类:问答Is it possible to subclass the immutable date class and override the __str__ method?
I am trying to subclass the immutable date class in Python, but I also need to override the __str__ method. So far, I have the following:[详细]
2023-03-09 09:44 分类:问答Efficient mass modification of persistent data structures
I understand how typically trees are used to modify persistent data structures (create a new node and replace all it\'s ancestors).[详细]
2023-03-08 19:40 分类:问答Immutable Object with ArrayList member variable - why can this variable be changed?
I have got one class with various member variables. There is a constructor and there are getter-methods, but no setter-methods. In fact, this object should be immutable.[详细]
2023-03-08 17:37 分类:问答copy() method in Java - any such thing?
I am following the well famous IBM tutorial on parsing an RSS feed. I tested it and I am getting a list of the first item only. In the AndroidSaxFeedParser, we can see that currentMessage is final whi[详细]
2023-03-08 11:35 分类:问答Does using public readonly fields for immutable structs work?
Is this a proper way to declare immutable structs? public struct Pair { public readonly int x; public readonly int y;[详细]
2023-03-07 06:27 分类:问答Equivalent of C# `readonly` keyword in D?
From what I understand while reading up on D, when using the immutable keyword on a variable, the value of the variable must be known at compile time, while C#\'s readonly need not be, and readonly fi[详细]
2023-03-06 09:36 分类:问答Immutable classes and memory in C++
So, I\'m getting deeper into C++ than I did in school as part of a personal project I\'m working on. I\'m a Java developer, so memory management is a little hard to get used to again, and now that I\'[详细]
2023-03-06 03:37 分类:问答Mutable vs. Immutable with business logic objects
A lot has been said about mutable / immutable objects in the data model. But what about the business logic? For example: a CD player. One class is responsible for playing the CD.[详细]
2023-03-05 18:05 分类:问答
加载中,请稍侯......