Passing BO as Parameter


Author
Message
Thomas Holste
Thomas Holste
Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

In my main project I have different BOs which I use. Now I am

trying something I can't get to work and need some advice.

I added a second project which will contain some classes which will be used in other projects too. Now I was wondering if I could pass a BO as a parameter to a class in this second project. For example:

Public class dogettitelsatz

Public Sub gogettitel(cTitel as string, oBO as ???)

...start searching for a specific record

End Sub

End Class

This class shall be instantiated in the main-project:

...Dim oTitel as new titelsatz

oTitel.dogettitel("1234567",gatitelBO1)

But I can't figure it out and I am asking myself, if this is just old VFP-habits and I should solve it any other way?

And I was wondering, if I would instantiate my "own" BO in the second-project, I could "use" the definition (Mapping) in my main-project and how this can be done?

Thanks a lot for your help

Thomas

Reply
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Adding to both Ivan and Edhy BigGrin ....



If the gogettitel will only work with BOs of type gatitelBO, then you could just do this:



Public Sub gogettitel(ByVal cTitel as String, ByVal oBO as gatitelBO)




I.e. you can skip the cast.



If you intended the gogettitel method to work with multiple types, that is also possible, but a bit more complicated.
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