﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Passing BO as Parameter</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 08 May 2026 02:52:01 GMT</lastBuildDate><ttl>20</ttl><item><title>Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28016.aspx</link><description>Hi there,&lt;/P&gt;&lt;P&gt;In my main project I have different BOs which I use. Now I am&lt;/P&gt;&lt;P&gt;trying something I can't get to work and need some advice.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;Public class dogettitelsatz&lt;/P&gt;&lt;P&gt;Public Sub gogettitel(cTitel as string, oBO as ???)&lt;/P&gt;&lt;P&gt;...start searching for a specific record&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;End Class&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;This class shall be instantiated in the main-project:&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;...Dim oTitel as new titelsatz&lt;/P&gt;&lt;P&gt;oTitel.dogettitel("1234567",gatitelBO1)&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;Thanks a lot for your help&lt;/P&gt;&lt;P&gt;Thomas</description><pubDate>Mon, 23 Aug 2010 06:59:39 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28052.aspx</link><description>Glad to hear that, Thomas!&lt;/P&gt;&lt;P&gt;You are most welcome. :cool:</description><pubDate>Mon, 23 Aug 2010 06:59:39 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28050.aspx</link><description>Hi Ivan,&lt;/P&gt;&lt;P&gt;thanks again for setting me in the right direction building a BO-library. That is exactly what I need.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas</description><pubDate>Mon, 23 Aug 2010 06:54:16 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28044.aspx</link><description>You're welcome.&lt;/P&gt;&lt;P&gt;Let us know of the outcome.</description><pubDate>Sat, 21 Aug 2010 13:15:21 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28043.aspx</link><description>Hi Ivan,&lt;/P&gt;&lt;P&gt;thanks for your tip, I'll try it right now.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas</description><pubDate>Sat, 21 Aug 2010 13:09:53 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28042.aspx</link><description>Hi Thomas.&lt;P&gt;It should be a best practice to have all your BOs in a Business Object Library, the help file has a section on this right at the tutorials. And yes, given the needed care to the references, what has been showed here to you should work just fine.&lt;P&gt;But I'm glad you got it working, anyway. ;)</description><pubDate>Sat, 21 Aug 2010 11:18:08 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28041.aspx</link><description>Hi Ivan, Hi Edhy, Hi Greg,&lt;/P&gt;&lt;P&gt;thank you for your tips but I am afraid to tell you that they do not work (Or at least I can't get it working?).&lt;/P&gt;&lt;P&gt;The reason probably is, that the BO and the Class are in different projects? And I can add a reference in my main project&amp;nbsp;(containing the BO-definition)&amp;nbsp;to the "class-project" but then not vice versa. So the main-project knows about the class, but the class not about the BO.&lt;/P&gt;&lt;P&gt;It is not really a problem because I added a new BO für the&amp;nbsp;needed table to the class-project and everything is working.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas</description><pubDate>Sat, 21 Aug 2010 10:43:47 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28031.aspx</link><description>Adding to both Ivan and Edhy :D ....&lt;br&gt;
&lt;br&gt;
If the gogettitel will only work with BOs of type gatitelBO, then you could just do this:&lt;br&gt;
&lt;br&gt;
[codesnippet]Public Sub gogettitel(ByVal cTitel as String, ByVal oBO as gatitelBO)[/codesnippet]&lt;br&gt;
&lt;br&gt;
I.e. you can skip the cast.  &lt;br&gt;
&lt;br&gt;
If you intended the gogettitel method to work with multiple types, that is also possible, but a bit more complicated.</description><pubDate>Fri, 20 Aug 2010 12:48:24 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28028.aspx</link><description>Hi Thomas,&lt;br&gt;
&lt;br&gt;
Adding to Ivan suggestion, keep in mind that if you have custom methods and properties in your BO, you need to CAST it to the correct type so you can see and use those custom methods/properties.&lt;br&gt;
&lt;br&gt;
[quote]&lt;br&gt;
Public Sub gogettitel(ByVal cTitel as String, ByVal oBO as MicroFour.StrataFrame.Business.BusinessLayer)&lt;br&gt;
    Using MyNiceBO as CTYPE(oBO,gatitelBO)&lt;br&gt;
       ' Now you can see your custom methods/properties.  Make sure you have the class gatitelBO available in your project.&lt;br&gt;
    End Using&lt;br&gt;
End Sub&lt;br&gt;
[/quote]</description><pubDate>Fri, 20 Aug 2010 11:18:35 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Passing BO as Parameter</title><link>http://forum.strataframe.net/FindPost28017.aspx</link><description>Hi Thomas.&lt;P&gt;Try this:&lt;P&gt;[codesnippet]&lt;P&gt;Public Sub gogettitel(ByVal cTitel as String, ByVal oBO as MicroFour.StrataFrame.Business.BusinessLayer)&lt;P&gt;[/codesnippet]</description><pubDate>Fri, 20 Aug 2010 06:49:34 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>