Skip to content

thenewcircle/advanced-java-20130122

Repository files navigation

advanced-java-20130122

Class Design

"Value class" recipe:

  • private final fields
  • constructor
  • getters (and setters if absolutely necessary)
  • hashCode/equals (implemented using only immutable state)

Immutability

  • safer class inheritance: easier to reason about polymorphism
  • safe structural (value) identity
  • sometimes provides performance benefits due to sharing

Concurrency

  • using built-in concurrency primitives (synchronized, wait/notify) is too hard
  • implement the producer-consumer pattern using BlockingQueue
  • don't reinvent the wheel: use akka!

Design Patterns

  • decorator: add behavior to existing object instances (e.g. java.io)
  • composite: build recursive data structures (e.g. abstract syntax trees)
  • visitor: apply arbitrary computation recursively over composite structures

Videos

Day 1:

Day 2:

Day 3:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages