InfoQ

InfoQ

Presentation

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Recorded at:
Recorded at

Immutable Object vs. Unsynchronized State

Presented by Joshua Bennett on Feb 22, 2011 Length 00:13:12     Download: MP3
     Slides
Sections
Architecture & Design,
Development
Topics
Java ,
Strange Loop 2010 ,
Strange Loop ,
Languages ,
Design Pattern ,
Architecture ,
Programming ,
Patterns ,
Object Oriented Design ,
Design ,
Conferences
 

How would you like to view the presentation?

In case you are having issues watching this video, please follow these simple steps to help us investigate the issue:
1. Right click on the video player and select Copy log
2. Paste the copied information in an email to video-issue@infoq.com (clicking this link will fill in the default details in most email clients).
Note: in case your email client hasn't automatically picked up the email subject, please include in your email the URL of the video too.
3. Done.
We will investigate the issue and get back to you as soon as possible. Thanks for helping us improve our site!
Summary
Joshua Bennett discusses immutable objects, what they are good for, when they are recommended to be used and when are to be avoided.

Bio
Joshua Bennett is a technical architect for CME Group. His days are spent designing and developing highly scalable and concurrent systems which need to handle the rigors of the high throughput low latency world of the futures and options trading industry. When he isn't working, he spends his time preparing for the inevitable zombie apocalypse by learning to operate various motorized vehicles.

About the conference
Strange Loop is a developer-run software conference. Innovation, creativity, and the future happen in the magical nexus "between" established areas. Strange Loop eagerly promotes a mix of languages and technologies in this nexus, bringing together the worlds of bleeding edge technology, enterprise systems, and academic research. Of particular interest are new directions in data storage, alternative languages, concurrent and distributed systems, front-end web, semantic web, and mobile apps.
  • This article is part of a featured topic series on Java
CopyOnWrite* by István Kovács Posted
  1. Back to top

    CopyOnWrite*

    by István Kovács

    A minor correction @12:00:
    CopyOnWrite* are not methods but classes. They do not return a new data structure when you modify them (that would mean CopyOnWriteArrayList breaks the contract of List, where add() is defined to return a boolean success indicator, not a List reference). They do, in fact, create a new data structure for internal storage; existing iterators will use the original data structure, and won't see any modifications, such as new elements added to the list; they will never fail with ConcurrentModificationException. The new data structure (array) is never exposed, and no new CopyOnWrite* object is returned.

    (ps. not all fields of String are final, yet it is effectively immutable; check its source if you're interested)