¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

Programming Idioms

jlab Informatik Alemán 5 fichas

Fichas del conjunto (5)

  1. 13 Advantages of "Immutable Objects"- inherently thread-safe
    - simpler to understand and reason about
    - safer
  2. 2Definition of "Immutable object"Objects that cannot change their state after creation.
    Sometimes the internal state can change.
  3. 3Common error in reasoning why "immutable objects" are avoided. Two reasons why this is not good reasoning.Programmers worry about the cost of creating a new object instead of updating one.
    Reason 1: Often, cost of garbage collection is decreased
    Reason 2: Code that protects mutable objects from corruption can be avoided
  4. 44 Characteristics of an immutable Java object.- no setters
    - all fields private and final
    -don't allow sublclasses to override methods (by declaring the class final or using factory methods)
    - don't store references to mutable objects
  5. 5Purpose of "defense copying"To avoid that the internal state of an object (often an object that is considered immutable) is changed by the manipulation of a contained object through a reference outside the object.

Información

Descripción
Informatik Fichas sobre Programming Idioms, creado por jlab el 31/08/2014.
Creado por
jlab
Visitas
18
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?