From 7cb8d1090aa7b5a31dd78d5e2734136c8e574420 Mon Sep 17 00:00:00 2001 From: Dobiasd Date: Mon, 13 Jan 2014 11:33:16 +0100 Subject: [PATCH] added abstract diagram showing the EP --- ...p_to_fp_-_inheritance_and_the_expression_problem.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/from_oop_to_fp_-_inheritance_and_the_expression_problem.md b/from_oop_to_fp_-_inheritance_and_the_expression_problem.md index d5a22b6..f3e637d 100644 --- a/from_oop_to_fp_-_inheritance_and_the_expression_problem.md +++ b/from_oop_to_fp_-_inheritance_and_the_expression_problem.md @@ -232,6 +232,16 @@ It's nice and terse and does everything we want. ## The expression problem +``` + ------------------ +----------- /-----> | A1, A2, B1, B2 | +| A1 | A2 | / ------------------ +----------- ----< +| B1 | B2 | \ ------------------ +----------- \-----> | A1, B1, A2, B2 | + ------------------ +``` + The subtle difference only gets obvious when you want to add new subclasses/subtypes or new functions to our software: - **Only the OOP solution makes it easy to add a new class.**