Is it bad or good to wrap mutable objects in immutable containers?
If I have parts of code that need to mutate the underlying data structure but then others that consume, not mutate the structure, is it good practice to create a wrapper which does not expose mutation operations?
Is it bad or good to wrap mutable objects in immutable containers?
If I have parts of code that need to mutate the underlying data structure but then others that consume, not mutate the structure, is it good practice to create a wrapper which does not expose mutation operations?
Designing entities that should be mutable through the GUI but protected from programmer error
I have a set of entities, for now represented by very simple classes (further simplified for this example):
Mutable with logic inside or immutable with logic outside?
I know immutable objects are preferred to mutable objects for reasoning and maintenance. But in occasions making a class immutable have some costs, let me explain it with a simple example:
Mutable with logic inside or immutable with logic outside?
I know immutable objects are preferred to mutable objects for reasoning and maintenance. But in occasions making a class immutable have some costs, let me explain it with a simple example:
Mutable with logic inside or immutable with logic outside?
I know immutable objects are preferred to mutable objects for reasoning and maintenance. But in occasions making a class immutable have some costs, let me explain it with a simple example:
Mutable with logic inside or immutable with logic outside?
I know immutable objects are preferred to mutable objects for reasoning and maintenance. But in occasions making a class immutable have some costs, let me explain it with a simple example:
Mutable with logic inside or immutable with logic outside?
I know immutable objects are preferred to mutable objects for reasoning and maintenance. But in occasions making a class immutable have some costs, let me explain it with a simple example:
How to make complex objects immutable?
The example I’m about to give is for the PHP language, but I think this scenario applies to most languages.
How to make complex objects immutable?
The example I’m about to give is for the PHP language, but I think this scenario applies to most languages.