﻿<?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?)  » Components on BOs</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 23:26:11 GMT</lastBuildDate><ttl>20</ttl><item><title>Components on BOs</title><link>http://forum.strataframe.net/FindPost14727.aspx</link><description>I have several BOs were I've dropped a component onto the design surface.  The component extends the BO and was a very easy way to deal with it.  &lt;br&gt;
&lt;br&gt;
Today, I was going crazy updating the field descriptors (way cool) and the BOs with these components all broke because the component had been added to the designer file by VS, which of course was rebuilt when the descriptors were changed, and thus my components were gone.  I fixed it by simply re-adding the components. But I'm wondering if there is a better way...&lt;br&gt;
&lt;br&gt;
So, the question is, what is the best way to deal with this?  Avoid components and add/manage them manually?  Bug SF to enhance the framework to deal with this? ;)   Is there an easier way to do this?&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Mon, 10 Mar 2008 10:22:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Components on BOs</title><link>http://forum.strataframe.net/FindPost14763.aspx</link><description>Thanks. I think I just add the component manually to the main BO file.</description><pubDate>Mon, 10 Mar 2008 10:22:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Components on BOs</title><link>http://forum.strataframe.net/FindPost14748.aspx</link><description>[quote]So, the question is, what is the best way to deal with this? Avoid components and add/manage them manually? Bug SF to enhance the framework to deal with this? &lt;IMG title=Wink src="http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Wink.gif" align=absMiddle border=0&gt; Is there an easier way to do this?&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;Well, just dropping them on the component was your issue here since it added it to the partial class, which as you already know, will be rebuilt through the BO Mapper.&amp;nbsp; However, you can get around this by manually adding the components in the main class instead of letting the designer decide where to place this.&amp;nbsp; Once you have added it, you should be able to interact with it.&lt;/P&gt;&lt;P&gt;Generally, if this is going to be a common type of control that we will be using over and over again, we will add it to the base business object class.&amp;nbsp; We have one called BoBase in our medical software that all of our BOs inherit from (BoBase inherits from BusinessLayer).&amp;nbsp; But if this is a less common occurance then we may just create a private and expose it through a property.&amp;nbsp; For example, we have some BOs where we want to expose a collection of the children records so we expose the children through a property on the parent BO:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;Public Class OrdersBBS&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits BusinessBindingSource&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private _Orders As New OrdersBO()&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&amp;nbsp;Readonly Property Orders As OrdersBO&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _Orders&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New()&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.BusinessObject = _Orders&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;End Class&lt;BR&gt;&lt;BR&gt;Public Class Customers&lt;BR&gt;&amp;nbsp;&amp;nbsp; Inherits BoBase&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; Private _Orders As New OrdersBBS()&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; Public Readonly Property Orders As OrdersBBS&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _Orders&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp; End Property&lt;BR&gt;End Class&lt;/P&gt;&lt;P&gt;[/codesnippet]</description><pubDate>Sun, 09 Mar 2008 11:13:06 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>