Components on BOs
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Components on BOsExpand / Collapse
Author
Message
Posted 03/07/2008 7:46:54 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
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.

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...

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?

Thanks!
Post #14727
Posted 03/09/2008 11:13:06 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:13:06 AM
Posts: 4,104, Visits: 4,176
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?

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.  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.  Once you have added it, you should be able to interact with it.

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.  We have one called BoBase in our medical software that all of our BOs inherit from (BoBase inherits from BusinessLayer).  But if this is a less common occurance then we may just create a private and expose it through a property.  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:

Public Class OrdersBBS
    Inherits BusinessBindingSource

    Private _Orders As New OrdersBO()

    Public Readonly Property Orders As OrdersBO
       Get
          Return _Orders
       End Get
    End Property

    Public Sub New() 
       Me.BusinessObject = _Orders
    End Sub
   
End Class

Public Class Customers
   Inherits BoBase

   Private _Orders As New OrdersBBS()

   Public Readonly Property Orders As OrdersBBS
      Get
         Return _Orders
      End Get
   End Property
End Class

Post #14748
Posted 03/10/2008 10:22:49 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
Thanks. I think I just add the component manually to the main BO file.
Post #14763
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 5:23pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 13 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.