diff --git a/courses/fundamentals_of_ada/130_program_structure/04-hierarchical_library_units.rst b/courses/fundamentals_of_ada/130_program_structure/04-hierarchical_library_units.rst index ca2185085..6192b8758 100644 --- a/courses/fundamentals_of_ada/130_program_structure/04-hierarchical_library_units.rst +++ b/courses/fundamentals_of_ada/130_program_structure/04-hierarchical_library_units.rst @@ -26,10 +26,6 @@ Problem: Packages Are Not Enough Solution: Hierarchical Library Units -------------------------------------- -.. container:: columns - - .. container:: column - * Address extensibility issue - Can extend packages with visibility to parent private part @@ -40,9 +36,33 @@ Solution: Hierarchical Library Units - Extensions all have the same ancestor *root* name - .. container:: column +------------------------------- +Visibility Across a Hierarchy +------------------------------- + +.. container:: overlay 1 + + .. image:: hierarchical_visibility_1.svg + :width: 70% + :align: center + +.. container:: overlay 2 + + .. image:: hierarchical_visibility_2.svg + :width: 70% + :align: center + +.. container:: overlay 3 + + .. image:: hierarchical_visibility_3.svg + :width: 70% + :align: center + +.. container:: overlay 4 - .. image:: hierarchical_library_units.png + .. image:: hierarchical_visibility_4.svg + :width: 70% + :align: center -------------------------- Programming by Extension diff --git a/images/hierarchical_visibility_1.svg b/images/hierarchical_visibility_1.svg new file mode 100644 index 000000000..212a2c5f1 --- /dev/null +++ b/images/hierarchical_visibility_1.svg @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + Our_Unit + + Visible Part + + Private Part + + + + Body + In a package, the body sees everything the private part sees,and the private part sees everything the visible part sees. + + + diff --git a/images/hierarchical_visibility_2.svg b/images/hierarchical_visibility_2.svg new file mode 100644 index 000000000..66e2da740 --- /dev/null +++ b/images/hierarchical_visibility_2.svg @@ -0,0 +1,364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Another package can see our visible part (dependingon where the "with" is), but nothing else. + + Our_Unit + + Visible Part + + Private Part + + + + Body + + Other_Unit + + Visible Part + + Private Part + + + + Body + + In a package, the body sees everything the private part sees,and the private part sees everything the visible part sees. + + + diff --git a/images/hierarchical_visibility_3.svg b/images/hierarchical_visibility_3.svg new file mode 100644 index 000000000..1e65ea640 --- /dev/null +++ b/images/hierarchical_visibility_3.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Our child's visible part can see our visible part,and its private part (and body) can see our private part + + Our_Unit + + Visible Part + + Private Part + + + + Body + + Other_Unit + + Visible Part + + Private Part + + + + Body + + + + + In a package, the body sees everything the private part sees,and the private part sees everything the visible part sees. + + + diff --git a/images/hierarchical_visibility_4.svg b/images/hierarchical_visibility_4.svg new file mode 100644 index 000000000..25fca01e7 --- /dev/null +++ b/images/hierarchical_visibility_4.svg @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Our private child can see our private partand visible part from anywhere + + Our_Unit + + Visible Part + + Private Part + + + + Body + + Other_Unit + + Visible Part + + Private Part + + + + Body + + + + + + In a package, the body sees everything the private part sees,and the private part sees everything the visible part sees. + + +