2013/10/11 Cédric Krier <[email protected]>:
> On 10/10/13 01:19 +0200, Cédric Krier wrote:
>> > >     - I will add a start_date and end_date on party.relation with an
>> > >       active Function field that deactivate the relation if current is
>> > >       out of the limit.
>> >
>> > Nice idea.
>> >
>> > >     - I'm wondering if party.relation.type should not simply have an
>> > >       option link to the reverse party.relation.type
>> >
>> > I prefer the current design because it is easier to configure.
>>
>> I don't like it because it rely on context and give a sens to the
>> relation. But the sens of the relation is already defined in
>> party.relation with the from-to
>
> There is just a small issue with this design it is that it duplicates
> the link between types. But I think it is not a big deal because it is
> just configuration part and I think there is no solution in relational
> world for this.
>
> After some talk with Bertrand, he was proposing to not use a query for
> the relation table but to really create the reverse relation.
>
> This design as some advantage:
>
>     - simple concept
>     - could enforce unique constraint (but I don't think such constraint
>       will be good)
>
> But it has also some disavantage:
>
>     - more work at creation
>     - could have creation conflict
>     - make reverse relation static (with other design if the reverse
>       relation type is changed, it applied on all relation
>       out-of-the-box)
>     - will require synchronisation between start/end date (or any other
>       attributes)
>
> So I still think the reverse query table is a better choice.
> If we agree I will update the wiki according.

Bertrand's suggestion is what Robin implemented but I agree it is
better to use a query.

-- 
Albert Cervera i Areny
Consultor funcional
Tel. 93 553 18 03
@albertnan
www.NaN-tic.com

Reply via email to