GoConqr has a new look! Let us know what you think.

Flashcards

Programming Idioms

jlab Informatik German 5 cards

Cards in this deck (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.

Information

Description
Informatik Flashcards on Programming Idioms, created by jlab on 31/08/2014.
Created by
jlab
Views
18
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?