replace_by_new_and_use_old

TODO: FT_77_15_06_50.dynamic_DAG.md: This use_case may become obsolete if we use "state name" -> "impl factory" naming where the factory cannot be replaced (currently, it is "state name" -> "impl class" directly).

Case: replace by new and use old

In this case we want to use both old and new implementations (e.g., the new implementation makes use of the old implementation).

Let's start with this diagram:

        graph TD
    a["a(A)"]
    b["b(B)"]
    c["c(C)"]
    d["d(D)"]

    a --> c;
    b --> c;
    c --> d;
    

Imagine, state c has to be implemented by class X but class X still wants to use class C somehow.

In that case:

  • add another state name (e.g.) c_2

  • implement that state c_2 by class C (which will still depend on a and b)

  • make c implemented by X depend on c_2 to use implementation C

        graph TD
    a["a(A)"]
    b["b(B)"]
    c["c(X)"]
    d["d(D)"]
    c_2["c_2(C)"]

    a --> c;
    b --> c;
    c --> d;

    a --> c_2;
    b --> c_2;
    c_2 --> c;