Skip to main content
Commonmark migration
Source Link

As per this link, it is an advice that:

A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same through the entire life of the object. In other words, an object should never betray those whom he represents. He should never change owners. :)

 

Be aware that immutability doesn't mean that all methods always return the same values. Instead, a good immutable object is very dynamic. However, he never changes his internal state.

Is it better to re-introduce collections(in java) like class LinkedList maintaining immutability of state by supporting operations like add/remove item?

Without performance overheads, Can this collection(class LinkedList) be introduced as immutable collection?

Because, below are the advantages in favor of immutability:

  • immutable objects are always thread-safe
  • they help to avoid temporal coupling
  • their usage is side-effect free

As per this link, it is an advice that:

A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same through the entire life of the object. In other words, an object should never betray those whom he represents. He should never change owners. :)

 

Be aware that immutability doesn't mean that all methods always return the same values. Instead, a good immutable object is very dynamic. However, he never changes his internal state.

Is it better to re-introduce collections(in java) like class LinkedList maintaining immutability of state by supporting operations like add/remove item?

Without performance overheads, Can this collection(class LinkedList) be introduced as immutable collection?

Because, below are the advantages in favor of immutability:

  • immutable objects are always thread-safe
  • they help to avoid temporal coupling
  • their usage is side-effect free

As per this link, it is an advice that:

A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same through the entire life of the object. In other words, an object should never betray those whom he represents. He should never change owners. :)

Be aware that immutability doesn't mean that all methods always return the same values. Instead, a good immutable object is very dynamic. However, he never changes his internal state.

Is it better to re-introduce collections(in java) like class LinkedList maintaining immutability of state by supporting operations like add/remove item?

Without performance overheads, Can this collection(class LinkedList) be introduced as immutable collection?

Because, below are the advantages in favor of immutability:

  • immutable objects are always thread-safe
  • they help to avoid temporal coupling
  • their usage is side-effect free
edited tags
Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50
deleted 287 characters in body
Source Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50

As per this link, it is an advice that:

A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same through the entire life of the object. In other words, an object should never betray those whom he represents. He should never change owners. :)

Be aware that immutability doesn't mean that all methods always return the same values. Instead, a good immutable object is very dynamic. However, he never changes his internal state.

Is it better to apply immutable property to re-introduce collections(in java) like class LinkedList rather than being mutable maintaining immutability of state by supporting operations like add/remove item?

Without performance overheads, Can such collectionsthis collection( like class LinkedList) be introduced as immutable collection?

Because, below are the advantages in favor of immutability:

  • immutable objects are always thread-safe
  • they help to avoid temporal coupling
  • coupling their usage is side-effect free

As per this link, it is an advice that:

A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same through the entire life of the object. In other words, an object should never betray those whom he represents. He should never change owners. :)

Be aware that immutability doesn't mean that all methods always return the same values. Instead, a good immutable object is very dynamic. However, he never changes his internal state.

Is it better to apply immutable property to re-introduce collections(in java) like class LinkedList rather than being mutable?

Without performance overheads, Can such collections( like LinkedList) be introduced as immutable collection?

Because, below are the advantages in favor of immutability:

  • immutable objects are always thread-safe
  • they help to avoid temporal
  • coupling their usage is side-effect free

As per this link, it is an advice that:

A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same through the entire life of the object. In other words, an object should never betray those whom he represents. He should never change owners. :)

Be aware that immutability doesn't mean that all methods always return the same values. Instead, a good immutable object is very dynamic. However, he never changes his internal state.

Is it better to re-introduce collections(in java) like class LinkedList maintaining immutability of state by supporting operations like add/remove item?

Without performance overheads, Can this collection(class LinkedList) be introduced as immutable collection?

Because, below are the advantages in favor of immutability:

  • immutable objects are always thread-safe
  • they help to avoid temporal coupling
  • their usage is side-effect free
deleted 287 characters in body
Source Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50
Loading
deleted 287 characters in body
Source Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50
Loading
deleted 287 characters in body
Source Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50
Loading
Post Closed as "Needs details or clarity" by CommunityBot, Kilian Foth, Bart van Ingen Schenau
Use a code block for multi line code.
Source Link
user40980
user40980
Loading
edited body
Source Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50
Loading
Source Link
overexchange
  • 2.3k
  • 3
  • 20
  • 50
Loading