Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing the code in class
Message
From
17/01/2005 01:15:59
 
 
To
All
General information
Forum:
ASP.NET
Category:
Class design
Title:
Optimizing the code in class
Miscellaneous
Thread ID:
00977659
Message ID:
00977659
Views:
57
In my framework DLL, I have several classes defined in several class files. In each file, I have this structure:
Public Class MyName

    Public Shared lError As Boolean = False
    Public Shared cError As String = ""
    Public Shared cErrorStackTrace As String = ""

    ' My list of functions here

    ' Initialize the default properties before the function gets called
    Private Shared Sub ErrorInitialize()
        lError = False
        cError = ""
        cErrorStackTrace = ""
    End Sub

    ' When an error occurs, we are setting up those properties
    ' expO1 Exception object
    Private Shared Sub ErrorSetup(ByVal toError As Exception)
        cError = toError.Message
        lError = True
        cErrorStackTrace = toError.StackTrace
    End Sub

End Class
In each file, I have definining those 3 public properties as well as those two functions. Wouldn't it be a way to only define that in one place?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform