[Schevo-devel] Why extent names instead of extent instances?
Matthew Scott
mscott at goldenspud.com
Fri Dec 9 09:41:21 EST 2005
On 12/9/05, Patrick K. O'Brien <pobrien at orbtech.com> wrote:
> Tom Locke wrote:
> > Hi
> >
> > Just wondered why you chose to use strings in various places, e.g.
> >
> > person.sys.links("PhoneNumber", "person")
> >
> > As opposed to
> >
> > person.sys.links(db.PhoneNumber, "person")
> >
> > Is it so you can refer to the entity before it has been declared? When
> > might that be necessary?
That would indeed be an interesting way of specifying extent names and
field names. I don't see a problem with supporting both for a while to
see which one works better.
To make it work, we'll need to create a .f namespace on each extent
that would contain the field specs for that extent. Then, we would be
able to do this:
person.sys.links('PhoneNumber') == person.sys.links(db.PhoneNumber)
person.sys.links('PhoneNumber', 'person') ==
person.sys.links(db.PhoneNumber.f.person)
>
> Off the top of my head I can't think of any situations where you would
> need to refer to the extent before it had been declared. Which reminds
> me, db.Foo refers to the extent, not the entity. I sometimes worry that
> the way we magically create both an entity class and an extent class out
> of the same class definition in the schema might be confusing. On the
> other hand, it works very well and I don't think it takes much to get
> used to it.
I've been comfortable with the Entity/Extent class separation and
naming from day one, so you won't be hearing me complain :)
--
Matthew R. Scott
More information about the Schevo-devel
mailing list