Design Question

Discussion in 'ASP .Net' started by Will, Apr 14, 2004.

  1. Will

    Will Guest

    I'm getting this error (system stack overflow) when attemping to
    instantiate a hastable or assigning a new hastable to the class
    property. I have a "base" class that uses the MustInherit keyword and
    I believe this is the cause...Every business rule must inherit from
    the base class...Am I using the class/key words correctly...base class
    below:

    Imports System.Web.UI.Page
    Imports System.Web.UI.WebControls.Label

    Namespace BusinessRules
    Public MustInherit Class AbstractBusinessRule
    Public Property mErrors() As System.Collections.Hashtable
    Get
    Return mErrors
    End Get
    Set(ByVal pErrors As System.Collections.Hashtable)
    mErrors = pErrors
    End Set
    End Property
    MustOverride Function Validate(ByVal pRecordNumber As Integer,
    ByVal pPortRecord As DataRow, _
    ByRef pErrLabel As Label)
    Protected Function SetError(ByVal pErrorField As String, ByVal
    pErrorMessage As String)
    mErrors.Add(pErrorField, pErrorMessage)
    End Function
    Event FinishedValidation(ByVal RetVal As Integer)
    End Class
    End Namespace

    Thanks
     
    Will, Apr 14, 2004
    #1
    1. Advertising

  2. Stack overflows almost always occur due to infinite looping or infinite
    recursion. Either of these situations can be created indirectly. That's what
    I would look for first.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Will" <> wrote in message
    news:...
    > I'm getting this error (system stack overflow) when attemping to
    > instantiate a hastable or assigning a new hastable to the class
    > property. I have a "base" class that uses the MustInherit keyword and
    > I believe this is the cause...Every business rule must inherit from
    > the base class...Am I using the class/key words correctly...base class
    > below:
    >
    > Imports System.Web.UI.Page
    > Imports System.Web.UI.WebControls.Label
    >
    > Namespace BusinessRules
    > Public MustInherit Class AbstractBusinessRule
    > Public Property mErrors() As System.Collections.Hashtable
    > Get
    > Return mErrors
    > End Get
    > Set(ByVal pErrors As System.Collections.Hashtable)
    > mErrors = pErrors
    > End Set
    > End Property
    > MustOverride Function Validate(ByVal pRecordNumber As Integer,
    > ByVal pPortRecord As DataRow, _
    > ByRef pErrLabel As Label)
    > Protected Function SetError(ByVal pErrorField As String, ByVal
    > pErrorMessage As String)
    > mErrors.Add(pErrorField, pErrorMessage)
    > End Function
    > Event FinishedValidation(ByVal RetVal As Integer)
    > End Class
    > End Namespace
    >
    > Thanks
     
    Kevin Spencer, Apr 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ZackS
    Replies:
    5
    Views:
    6,834
    Just an Illusion
    Jul 9, 2004
  2. SpamProof
    Replies:
    3
    Views:
    656
    SpamProof
    Dec 1, 2003
  3. dave
    Replies:
    5
    Views:
    603
    William Brogden
    Jul 17, 2004
  4. Tim Smith
    Replies:
    2
    Views:
    867
    Tim Smith
    Dec 15, 2004
  5. Bartholomew Simpson

    class design/ design pattern question

    Bartholomew Simpson, Jun 12, 2007, in forum: C++
    Replies:
    2
    Views:
    456
    Daniel T.
    Jun 12, 2007
Loading...

Share This Page