RealmOwner Model
  • Every realm has

    RealmOwner, even the default realms (CLUB, USER, and GENERAL)

  • RealmOwner.realm_id is not a sequence.

    PrimaryId values comes from realm class ( User and Club)

  • Default RealmOwner.realm_id is the integer value of the

    RealmType, e.g. GENERAL realm type's integer value is 1 and so is its RealmOwner.realm_id

  • RealmOwner identifies name (handle), display_name, password, realm_type, and creation_date_time

Notes:

A RealmOwner exists for every realm, even the default realms. The default realm values are like the "null" record. They aren't true "owners" of a realm. This will be discussed on the next slide. However, it is convenient to be able to treat the default realms as any other realm for RealmRole.

The distinction between a RealmOwner and Realm is a subtle one. Next slide will discuss Bivio::Auth::Realm in detail.

RealmOwner records are not linked to any other table. Whenever a User or Club model is created, a corresponding RealmOwner record is created whose realm_id is the user_id and club_id, respectively. The relationship cannot be constrained due to the inverse order of creation. These numeric values do not collide in bOP. (Indeed, all instance identifier sequences are globally unique.)

There are three default realms: Club, User and General. These realms do not have owners, but they do have RealmOwner records. That is, no records are owned by the default realms except for the RealmOwner and RealmRole records. The existence of these RealmOwner records solves the "null" instance problem in a few cases that would be otherwise cumbersome to program. More details on the subject of these realms in the following solids.

The rest of the data in the RealmOwner model gives the realm a handle for email addresses and logging in, a display_name to show in menus and titles, a password (only valid for users), a realm_type to identify which Bivio::Auth::Realm class to load, and a creation_date_time for auditing and display purposes.