The Cancer pattern has a word we do not have a favorable view of. However, this pattern is becoming needed in more and more environments. This pattern is one for conversions and migrations. We do not always have a clean slate for our architecture. Thus, we need designs to handle the modification of an existing architecture.
The Cancer Pattern Defined
The way Cancer evolves is that it replaces cells with something new while leaving things functional. This approach is how we often want to replace a system in place. We cannot shut things down and might not be able to do a swap. The cancer pattern is a sort of “hot swap” of a system with a new solution. We do not address the entire thing at once. Instead, we selectively update, upgrade, or replace pieces at a time. As time goes on, we can entirely replace the system. Sometimes without end-users being any the wiser.
Applying The Pattern
The key to this pattern is to isolate the pieces of the original architecture. We want to avoid making more changes than needed. Likewise, we do not want to de-stabilize the current system. Think of a Jenga game where instead of removing blocks from the stack, you are replacing them. When we replace a piece of the system, we want to make sure we do it in a way that mirrors existing integrations wherever possible. You can review the microkernel pattern for another way that components are viewed as a plug-and-play approach to functionality.