You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every singleton in the code uses the same boilerpoint code:
Dim Something_Singleton__
Public Function Something()
If IsEmpty(Something_Singleton__) Then
Set Something_Singleton__ = New Something_Class
Something_Singleton__.Initialize ...
End If
Set Something = Something_Singleton__
End Function
It would be handy if this code could just be generated on the fly. However, VBScript's 2-phase parsing might make this impossible (this was the reason the singleton pattern was developed in the first place). These phases are:
Compile all of the functions that are defined in the script
Execute the body of the script
Unfortunately, we cannot solve the singleton issue by simply generating all of the code in phase 2. We cannot guarantee the order in which files will be executed, so one file may refer to a function in another file that has not been generated/defined yet.
The text was updated successfully, but these errors were encountered:
Every singleton in the code uses the same boilerpoint code:
It would be handy if this code could just be generated on the fly. However, VBScript's 2-phase parsing might make this impossible (this was the reason the singleton pattern was developed in the first place). These phases are:
Unfortunately, we cannot solve the singleton issue by simply generating all of the code in phase 2. We cannot guarantee the order in which files will be executed, so one file may refer to a function in another file that has not been generated/defined yet.
The text was updated successfully, but these errors were encountered: