QueryObjectModelConstantsInterface inconsitency and potential change

3 views
Skip to first unread message

dan.t...@gmail.com

unread,
May 13, 2014, 3:38:00 PM5/13/14
to jackal...@googlegroups.com
Hi,

As discussed in: https://github.com/phpcr/phpcr/pull/76/files

The QueryObjectModelConstantsInterface is basically a class which contains Constants, it has no
logic and no classes will ever implement it - it exists to provide constant values, not to provide a class interface.

As such is would seem that it should have been originally implemented as final concrete class, QueryObjectModel. This
would be consistent with classes which play identical roles such as `PropertyType` and `OnParentVersion`.

These final classes also provide invaluable methods for getting the constant names from values and vice-versa:

    https://github.com/phpcr/phpcr/blob/master/src/PHPCR/PropertyType.php#L223

So I propose introducing such a class `QueryObjectModel` with the nameFromValue and valueFromName methods.

@dbu suggests maintaining backwards compatibility by extending the Interface.

What do people think?

Dan
Reply all
Reply to author
Forward
0 new messages