Subclass Business Object


Author
Message
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi,

I have a child BO that needs to have many parent relationships. I know one child BO can only have one parent BO so I thought the solution was to subclass the child and set the ParentRelationship for each one. However, when I open the subclassed child BO in the designer, the ParentRelationship option is not visible in the Properties window. However, it is visible for the original child BO that is subclassed to MicroFour.StrataFrame.Business.BusinessLayer.

The strange thing is other SF properties (such as IncludeInFormSave) are visible in the subclassed BOs.

Have I missed something?

Thanks in advance,

Aaron

 


Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I just created a sample and it worked.  So I guess that question would be more at the root level (your class and subclassed BO).  In fact, we do this ourselves all of the time, so if you have a BO that inherits from BusinessLayer (this would be your base) and then your BO inherits from your base, you should see it.

There is logic to prevent this property from appearing within designer dialogs (i.e. dropped on a form, etc.) so it sounds like something is going on in regards to inheritance.  You might send me a sample of your code so I can see what is going on.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Do you have a timescale on this?

We have a lot of balls in the air and there are really a lot of new features already being implemented in the 1.6.6 (a lot more than is currently posted on the forum).  It is my desire to wrap up the 1.6.6 beta by the end of June (which would hopefully include this new feature)...but it may not make it into the 1.6.6 build depending on time constraints and testing.

Why? is there a design limitation for this?

This is a lengthy topic...but basicially it isn't necessary.  We have been doing this within our medical app for around a year now so it is tried and testing.  The parent relationship is generally always necessary, however, the foreign key fields may not be.  By placing it in this collection it would always force the foreign key field BO to be present...even when it isn't necessary.  We can talk about this more in class...but there are a lot of reasons and this is the road we initially went down and by pulling it out and putting it into a shared class, we use it for all types of scenarios.  You can even have multiple BOs talking to the same relationship source, etc. which you could not do in a designer type environment.  So it is basically to remove limitations, not create them.

Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
With the following exceptions, I haven't added any extra code to the BOs beyond what is created as a default.  In the following example, both BOs have been mapped to the same underlying table using the BO Mapper. I then changed the definition of the second DeliveryDistanceEnquiry class to inherit from the original DeliveryDistance class which is inherited from BusinessLayer.

public partial class DeliveryDistance : MicroFour.StrataFrame.Business.BusinessLayer

public partial class DeliveryDistanceEnquiry : DeliveryDistance

I can see ParentRelationship when I open DeliveryDistance in the component designer but I don't see it when opening DeliveryDistanceEnquiry. However, it is worth noting that I can see other SF BO properties when I open the DeliveryDistanceEnquiry in the component designer.

ParentRelationship appears to have been selectively hidden in the designer.


Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
However, it is worth noting that I can see other SF BO properties when I open the DeliveryDistanceEnquiry in the component designer.

I know, you have mentioned that several times and I had tried to addres this on some other threads and apparently I didn't get my point across.  The ParentRelationship property is treated differently than all other properties.  It is intentionally hidden outside of the component designer, so there is something in the mix that is making this property and the environment that you have setup think that the object you are dealing with is an instance versus a designer window.

I created a sample in C# and it worked as it should.  You might be able to see where your problem is by looking at this code.

Attachments
BoInhertianceSample.zip (133 views, 53.00 KB)
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
[I know, you have mentioned that several times and I had tried to addres this on some other threads and apparently I didn't get my point across.  The ParentRelationship property is treated differently than all other properties.  It is intentionally hidden outside of the component designer, so there is something in the mix that is making this property and the environment that you have setup think that the object you are dealing with is an instance versus a designer window.

Ah I see what you were saying now - sorry Smile

Okay, thanks for the sample project (which works). I checked and I didn't see any differences between your code and mine. So I added two new BOs and subclassed one from the other. I could see the ParentRelationship from both BOs. The only difference between these new BOs and my original ones is that the latter were both mapped to the same table in the DDT whereas the new BOs were not mapped to anything.

In your sample project you have MyBaseBO and MyInheritedBO. Which one would you map to the table in the DDT? Would you map only one or both?

I think it is breaking in the BO Mapping.

Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
By the way, the current one parent per BO limitation is the only thing I could complain about SF and it looks like you are removing this issue. Even then it wasn't a big complaint!

I have only been with SF for a couple of weeks and have made BIG progress in converting my app from a rival system. Just wanted to post this as I don't want there to be any confusion as I know they are reading this! Smile

Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Using your sample class names, I lose the ParentRelationship when I use the Business Object Mapper to map the MyBaseBO to a table in my DDT. As soon as I do that, I can nolonger see the ParentRelationship in MyInheritedBO.

As I would like to store all my code in MyBaseBO, I would have thought I needed to map it to the DDT to have access to the field names, etc.

Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Got there Smile

It works when MyBaseBO is NOT mapped in the BO Mapper and MyInheritedBO is mapped.

No big deal in the end Smile Thanks for the help.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Glad you got it worked out. Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Aaron Young - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Edhy Rijo - 17 Years Ago
Aaron Young - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         [quote]Do you have a timescale on this? [/quote] We have a lot of...
Trent L. Taylor - 17 Years Ago
                         With the following exceptions, I haven't added any extra code to the...
Aaron Young - 17 Years Ago
                             [quote]However, i t is worth noting that I can see other SF BO...
Trent L. Taylor - 17 Years Ago
                                 [quote][I know, you have mentioned that several times and I had tried...
Aaron Young - 17 Years Ago
                                     By the way, the current one parent per BO limitation is the only thing...
Aaron Young - 17 Years Ago
                                         Using your sample class names, I lose the ParentRelationship when I...
Aaron Young - 17 Years Ago
                                             Got there :) It works whenMyBaseBOis NOT mapped in the BO Mapper...
Aaron Young - 17 Years Ago
                                                 Glad you got it worked out. :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search