🖥️ VB CURSE DIFFICULTY: Adept Structural

The Proxy of Network Calls

Standing in for a distant DCOM server that may or may not exist.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Conjuration // Remote Evocation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// VB PATTERN //
' IRemoteRitual.cls
Public Sub Execute()
End Sub

' DCOMProxy.cls
Implements IRemoteRitual
Private m_remoteObject As Object

Private Sub IRemoteRitual_Execute()
    On Error Resume Next
    If m_remoteObject Is Nothing Then
        ' Attempt the dark art of remote instantiation
        Set m_remoteObject = CreateObject("Remote.Ritual", "\\CursedServer")
    End If

    If Not m_remoteObject Is Nothing Then
        m_remoteObject.Execute
    Else
        MsgBox "The remote server ignores your summons."
    End If
End Sub

The Proxy acts as an avatar for remote entities across the DCOM boundary. It controls access, defers expensive network instantiation, and silently swallows RPC server unavailable errors.

Runic Tags: #proxy #dcom #remote