Business Object Relationships


Author
Message
Robert Linton
Robert Linton
StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)
Group: Forum Members
Posts: 13, Visits: 49
I've got 3 business objects defined as follows:

CaseBO {pkCaseId, CaseDesc, fkClientId, fkContactId}

ClientBO {pkClientId, ClientName}

ContactBO {pkContactId, ContactName, fkClientId

I've created a form, called Case Form

On my Case form I have an instance of all three BO's, successfully related, and as I navigate the CaseBO I can display any number of fields from the related Client and Contact BO's. All's well so far...

Now I create a second form, Client Form.

I drop an instance of the ClientBO and ContactBO and begin to setup the relationships...here's where I run into an issue. In order to setup a relationship between these instances of ClientBO and ContactBO on the new form (clientBO1.pkClientId<->contactBO1.fkClientId), I have to break the relationships I'd set up on the first form (caseBO1.fkClientId<->clientBO1.pkClientId & caseBO1.fkContactId<->contactBO1.pkContactId)

It seems that a BO will only allow one association? I'm sure I'm missing something here, I don't think that's correct because, if it is, I'd have to create a new BO for each kind of association...duplicating a lot of code in the process.

TIA,

Rob

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Rob,



Yes, you define the relationship parameters at the class level, so a business object is intended to have the same relationship parameters, no matter what the instance. However, the actual business object that comprises the other end of the relationship is defined on a per-instance basis. So, you define the parent relationship parameters once, which defines the fields that make up the key, and then you assign the parent object on a per-child instance basis.



As you mentioned, however, you can create two different associations by creating two different business object classes... but, you can avoid the code duplication by inheriting one from the other. The subclass would then only need to redefine the relationship parameters.



Now, in the case of a many-to-many relationship, where the link table requires two different relationships at the same time, you can use the BusinessLayerLinkManager class. It allows you to specify the relationships between the 3 business objects that comprise the many-to-many relationship and will maintain the referential integrity between those 3 business objects.
Kevin Lingofelter
Kevin Lingofelter
StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)
Group: Forum Members
Posts: 77, Visits: 804
Is this just a matter of dropping the link manager on a form and setting the properties?
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
Yes.  Drop a BusinessObjectLinkManager on a form and set the respective properties.  You will also need to have the three business objects that you plan to use on the form so they can be associated with the LinkManager.  As you move forward let me know if you have any questions.  We will be releasing the docs for this in the next week.
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