Subclass Business Object


Author
Message
Aaron Young
Aaron Young
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 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

 


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Have I missed something?

This property is slightly different and can only be seen when using the component designer (not visible from within an instance of an object [i.e. dropped on a form]).  I will work just fine thought if you open the inherited BO within a component designer (i.e. double-click the BO from the solution explorer).

Just FYI, we will be adding the ability to register as many foreign key relationships as you would like.  You will only be able to do one through the standard designer (like now), but in code, you can register as many foreign key relationships as possible.  We have already implemented this within our medical app and it will become part of the framework.  If all works out then it will be in the final 1.6.6 build otherwise it would most definitely be in the 1.6.7 build.

Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (05/26/2008)
Have I missed something?

Just FYI, we will be adding the ability to register as many foreign key relationships as you would like.  You will only be able to do one through the standard designer (like now), but in code, you can register as many foreign key relationships as possible.  We have already implemented this within our medical app and it will become part of the framework.  If all works out then it will be in the final 1.6.6 build otherwise it would most definitely be in the 1.6.7 build.

Glad to hear about this since I am about to need that functionality in my application next stage. Tongue

You will only be able to do one through the standard designer (like now)

Why? is there a design limitation for this?

Edhy Rijo

Aaron Young
Aaron Young
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I am actually using the Component Designer (i.e. double-click on the inherited BO in the solution explorer) and the ParentRelationship is missing from the Properties window as below.

Glad to hear you will be offering multiple relationships in 1.6.6 or 1.6.7. Do you have a timescale on this? If it is going to be soon then I will try and wait but I do really have an immediate need for it. If not, then I will subclass the BO provided I can get passed this problem.

Thanks.


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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 (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 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 (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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 (109 views, 53.00 KB)
Aaron Young
Aaron Young
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 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
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search