Skip to content

Commit 1f783f0

Browse files
committed
Tightened up formatting for references to code.
1 parent b70db82 commit 1f783f0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

blogs+posts/software-engineering/espresso/object-construction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ The mechanics of this approach meant that I had to provide a copy-constructor im
7676
Of course, this approach didn't work.
7777

7878

79-
Even though this succeeded in providing the `ArgMg` object with a valid reference to a renderer object, declaring the `stdoutArgRenderer` on the stack meant that it got destructed when the factory method returned. The valid reference referenced invalid memory causing an Access Violation.
79+
Even though this succeeded in providing the `ArgMgr` object with a valid reference to a renderer object, declaring the `stdoutArgRenderer` on the stack meant that it got destructed when the factory method returned. The valid reference referenced invalid memory causing an Access Violation.
8080

81-
Incidentally, things work when the user explicitly declares the ArgRenderer (as above) because it will still exist on the stack.
81+
Incidentally, things work when the user explicitly declares the `ArgRenderer` (as above) because it will still exist on the stack.
8282

8383
My first reaction was that, despite my best efforts, I was going to have to rely on the renderer object being allocated on the heap. I couldn't utilize concrete objects **and** rely on dynamic types at runtime. The `ArgMgr` class couldn't know the concrete type of the object it was interacting with here. It had to use a pointer or reference in order for that dynamic relationship. In this instance, it's clear that the GC approach deployed in Java provides a greater degree of freedom in facilitating Dynamic Injection (DI) and the Inversion of Control (IoC) pattern.
8484

0 commit comments

Comments
 (0)