Saturday, September 21, 2013

Refactoring Screencasts IV

Continuing the series, here are the screencasts for Simplifying Conditional Expressions.  Enjoy!

Decompose Conditional

Consolidate Conditional Expression

Consolidate Duplicate Conditional Fragments

Remove Control Flag

Replace Nested Conditional With Guard Clauses

Replace Conditional With Polymorphism

Introduce Null Object

Introduce Assertion

Tuesday, September 3, 2013

Refactoring Screencasts III

I know, this took a lot longer than expected. But it's been an interesting summer employment-wise. Lots of travel, lots of experiences, etc. I finally finished this series though, and have continued well into the next one.

It's worth noting that I skipped three of the patterns in this series.
  • I skipped Self-Encapsulate Field because the differences in how inheritance work in C# vs. Java were getting in the way, and ultimately the C# version was essentially identical to Encapsulate Field.
  • I also skipped Duplicate Observed Data because a lot has changed over the years in terms of data binding and the tooling that's available.
  • And I skipped Replace Record With Data Class because in modern tooling it seemed really similar to Replace Array With Data Class. (Though it's likely that I missed a key point/difference.)

Without further ado, here are the videos for the Organizing Data patterns:

Replace Data Value With Object

Change Value To Reference

Change Reference To Value

Replace Array With Object

Change Unidirectional Association To Bidirectional

Change Bidirectional Association To Unidirectional

Replace Magic Number With Symbolic Constant

Encapsulate Field

Encapsulate Collection

Replace Type Code With Class

Replace Type Code With Subclasses

Replace Type Code With State/Strategy

Replace Subclass With Fields