BO's as properties


Author
Message
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
Thanks for the info,  will do.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You could add a handler to the Disposed() method on the business object or just override the Dispose() method on the business object and manually call dispose on those object references if they are not null.

protected override Dispose(bool disposing)
{
    //-- Make the base call
    base.Dispose(disposing);

    //-- Make sure we're disposing
    if (disposing)
    {
        //-- Make sure we have a reference to the bo and dispose of it
        if (this._boname != null)
        { this._boname.Dispose(); }
    }
}

Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
I have classes setup with BO's as properties.

private MyBO _boname = null;
private MyBO boname
{
   get
   {
      if (_boname == null)
         _boname = new MyBO();
      return _boanme;
   }
}

My question is I remember reading some where in the documentation that when a BO is created thru code that the Dispose() method should be called.  Where would I be putting that call?  Should I even be doing something like this?  I have done this on some BO's that require using other BO's to complete a process, that way the helper BO's don't need to be created unless they are needed.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search