How to model this in ORM
Date: 13 Jan 2003 23:51:55 -0800
Message-ID: <915c8a9f.0301132351.173d0d9a_at_posting.google.com>
Dear all,
I'm trying to model ownership of a building using ORM, and I find the task quite complicated. If any experienced modeler could help me, I would be very grateful.
Let's say we have three object:
Storey,
Apartment,
Person
And then we set some base facts:
F1: Apartment belongs to exactly one storey, storey has zero or more
apartment.
F2: Person owns zero or more Storey, Storey is owned by zero or more
Person.
F3: *Derived*: Person owns Apartment iif Person owns Storey and Tract
belongs to that Storey.
So far so good. But now things start to complicate. There are some
more rules which I don't manage to transform into facts:
R1: Apartment can be owned by a zer or more Person, Person can own
zero or more Apartment. Note: this is very similar to F3, but F3 is
derived while R1 should be base fact.
C1: If apartment is owned by a Person, then storey to which apartment
belongs can not be owned by any Person.
C2: If storey is owned by a Person, then no Apartment that belongs to
that Storey can have owned.
I hope you understand my idea. Ownership can be managed in two ways:
- either a person (or more persons) own a Storey and transitively own
all apartments that belong to that storey
- or person (or more persons) own Apartment – in that case that storey
can not be owned by a person
Of course the story goes on… Just add a Building and a Zone (e.g. Industrial Zone that has many buildings) and it feels like having a pangalactic gargle blaster.
Any help will be much appreciated.
Regards,
Jernej Kase (removethisjernej.kase_at_rzisnik-perc.sinospam) Received on Tue Jan 14 2003 - 08:51:55 CET