What are the disadvantages of immutable objects?

Asked

Viewed 57 times

3

It is notorious the advantages of immutable objects, such as: they are more reliable because they are never changed; they are thread-safe, as they have no problems with synchronization when several threads change the same object; can be curled and have no complex state spaces that change over time as they are static, etc.

But if immutable objects offer more benefits than opposite programming, they are considered more reliable and provide a simpler and more cohesive program, because most developers and projects continue to create mutable objects?

Updated

Some disadvantages can be found this link of the website itself, but I would still like to know what makes most developers and projects not adopt the practice of creating immutable objects if the same, theoretically, are the solution to most problematic bugs with impact on production.

Updated 2

I would also like to know what software modeling standards, OO or functional, facilitate the use of immutability.

  • As I read in a book once: more important than knowing how something works is knowing how it doesn’t work.

  • Hi, guys. This space is to answer questions. If it is not to help, do not disturb. I found very pertinent your question. I agree with Anderson. Check out this link.https://pt.wikipedia.org/wiki/Objeto_imut%C3%A1vel

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.