Modeling relationshps with properties

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Sparkblender
Posts: 32
Joined: Fri Feb 01, 2013 3:31 pm
Location: USA

Modeling relationshps with properties

Post by Sparkblender »

I was wondering if this is the right way of modeling/implementing a relationship with properties in AwareIM, i.e. similar to an edge with properties in a graph database:

https://www.screencast.com/t/BYQkKoxvC

I understand that AwareIM doesn't require building auxiliary tables/BO's in many-to-many relationships, but I'm wondering if in the above case, where the relationship itself has properties, would require creating such a BO, or if there is a different/smarter way of implementing this.

Cheers.
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Modeling relationshps with properties

Post by customaware »

Hi Spark,

If the M:M Relationship requires Attributes of it's own, then, yes... you create an intermediate BO
Just keep in mind how you would want to handle orphaned records.

You can either decide which of the two BOs you are referencing is the most logical parent so that you can set the Reference to Owned By (enforcing cascading deletes).
This can be an issue as that BO should NOT be Owned by more that 1 BO.

Better option is to handle the intermediate BO via Processes.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Sparkblender
Posts: 32
Joined: Fri Feb 01, 2013 3:31 pm
Location: USA

Re: Modeling relationshps with properties

Post by Sparkblender »

Hi Mark,

thanks for your prompt comments.

Yes, you are right. I actually made a mistake; the PersonSite-->Person relationship should be as follows to ensure integrity:

https://www.screencast.com/t/HNFY7Tqgm0A

Cheers,
Mathias.
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Modeling relationshps with properties

Post by customaware »

Be Careful Spark....

That looks to me like you have Owned Reference between Site <--> PersonSite and Person <--> PersonSite

I would manage PersonSite using Processes and hence both References should be Peer

Site:

Company
Address1
Address2
Adderss3
City
State
Postcode
Country
pm_PersonSite

PersonSite

ps_Site (Peer Single Reference to Site - Matching Reference pm_PersonSite [Multiple])
ps_Person (Peer Single Reference to Person - Matching Reference pm_PersonSite [Multiple)
EmployedAt
CurrentlyWorkingAt
HomeAt
CurrentlyStayingAt


Person

FullName
FistName
LastName
pm_PersonSite

Note: Create the Reference From PersonSite BO rather than from the Site or Person BO.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Sparkblender
Posts: 32
Joined: Fri Feb 01, 2013 3:31 pm
Location: USA

Re: Modeling relationshps with properties

Post by Sparkblender »

I see what you are saying.
Thanks!
Post Reply