Passing Business Objects as variables


Author
Message
choyt
choyt
StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)
Group: Forum Members
Posts: 78, Visits: 246
Hi All

I want to pass a business object from one method to another. At first this seemed pretty simple but I'm not having much success except to do it as a generic object.  Am I missing something really dumb, is there another way or is this just it?

Public Sub DoIt(b as strataframeobject)

       ' in this example, i want to be able to pass different objects and load the results into cache

end function

Thansk!

Replies
choyt
choyt
StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)
Group: Forum Members
Posts: 78, Visits: 246
Hi Folks

The inheritance idea works great except for one problem. When your BO inherits from an abstract class (instead of MicroFour.StrataFrame.Business.BusinessLayer directly) the designer no longer works.

The only drawback to this that I can see is having to manually edit properties such as CRUD, required fields, etc.

Can anyone else think of a reason not to do this?

Thanks!

Clay


Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I didn't know that about the abstract class. Well, you could just make the CachedBO a normal class and then make the FillForCache an actual method:

Public Class CachedBO

Inherits BusinessLayer

' make it overridable, and it does nothing...subclasses must implement this.

Public Overridable Sub FillForCache()

End Sub

End Class


Now when you inherit, you just override the FillForCache() method. This should work with the designers, its just normal inheritance. In this case you are trading a cleaner coding style (abstract class...explicitly defining the intent of the abstract class) for a more convenient coding style (use of designers, less typing/typos).
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