﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Access Business Object Gloabally</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 10 Jun 2026 20:37:33 GMT</lastBuildDate><ttl>20</ttl><item><title>Access Business Object Gloabally</title><link>http://forum.strataframe.net/FindPost5714.aspx</link><description>I have created a business object to access a XML datasource. I can access no problem but I would like to create some type of global reference of the business object within the appMain so I only have to create and fill it once&amp;nbsp;and use it throughout the application.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Hopefully this makes sense. Right now I find myself having to call the fill method to create the object each time I want to access data, so I thought there may be a more efficient way of doing this.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;</description><pubDate>Thu, 11 Jan 2007 14:26:35 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Access Business Object Gloabally</title><link>http://forum.strataframe.net/FindPost5766.aspx</link><description>Thanks Paul and Ben, this is exactly what I was looking for.</description><pubDate>Thu, 11 Jan 2007 14:26:35 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Access Business Object Gloabally</title><link>http://forum.strataframe.net/FindPost5739.aspx</link><description>Yep, Paul's got it right.&amp;nbsp; You can create a "static" class somewhere to house your global variables.&amp;nbsp; Then, just make the variables (or properties that wrap the variables) public and shared (static) and you'll be able to access them from anywhere within the application.&lt;/P&gt;&lt;P&gt;And in VB, you can even import the class name like this so you can reference the variables without having to type the classname first:&lt;/P&gt;&lt;P&gt;Imports MyRootNamespace.MyStaticClass</description><pubDate>Thu, 11 Jan 2007 11:21:08 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Access Business Object Gloabally</title><link>http://forum.strataframe.net/FindPost5724.aspx</link><description>Tim,&lt;/P&gt;&lt;P&gt;I just do something like this. Not sure if it is the best way to do it but it works okay for me. I have a common class that has shared property's and methods that I use throughout my application, in this instance to get the office name I would to something like this &lt;FONT size=2&gt;common.OfficeProfile.OFP_OfficeName&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;here is an example &lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;NotInheritable&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Class&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; Common&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Hide Constructor so class canot be instaniated&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt;()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Shared&lt;/FONT&gt;&lt;FONT size=2&gt; _OfficeProfile &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; PayrollBO.BOOfficeProfile&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Shared&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ReadOnly&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;FONT size=2&gt; OfficeProfile() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; PayrollBO.BOOfficeProfile&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'see if Biz Obj is filled&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; _OfficeProfile.Count &amp;lt;= 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;_OfficeProfile.Fill()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; _OfficeProfile&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 10 Jan 2007 13:02:12 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item></channel></rss>