Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing the code in class
Message
De
17/01/2005 01:15:59
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Optimizing the code in class
Divers
Thread ID:
00977659
Message ID:
00977659
Vues:
58
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform