GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Programming Idioms

jlab Informatik Deutsch 5 Karten

Karten in diesem Stapel (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.

Informationen

Beschreibung
Informatik Karteikarten am Programming Idioms, erstellt von jlab am 31/08/2014.
Erstellt von
jlab
Aufrufe
18
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck