[Dbix-class] "Alias" schema option

Christopher H. Laco claco at chrislaco.com
Wed Apr 5 18:37:30 CEST 2006


Brandon Black wrote:
> On 4/5/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
>> Christopher H. Laco wrote:
>>>> So, the question now becomes, what does everything think?
>>>>
>>>> Should we leave ->name alone, and make something new like
>>>> result_source_name(), or do we forge ahead with changing the meaning of
>>>> what ->name() returns?
>>>>
>>>> -=Chris
>>>>
>>> The more I think about this, the more I don't like it.
>>> I think adding table_name, and having from() return table_name is a good
>>> thing. But I think name should just return what it always has.
>>>
>>> name() can mean different things to different modules, in different
>>> parts of the dist.  I'd personally much rather see source_name(). That's
>>> a little more clear IMHO on what it will return.
>> Mmm, I can see that one. Plus it means the same source can exist in more than
>> one schema with a different name in the scheme but the same ->name.
>>
>> Not sure source_name is quite right though. schema_name suggests the name of
>> the schema, name_in_schema sucks. Er. Ideas, anybody?
>>
> 
> This also touches on (to some degree) the whole issue of best
> practices for namespace management (class names) of the various
> classes related to a single table (the ResultSource, the ResultSet,
> and the Result classes), ResultSetManager and the related issues of
> "default" resultset_class's (::_resultset? ::ResultSet?
> MySchema::ResultSet::Foo? etc) and the load_classes M::F thing (in
> that it would be nice if ->load_classes() would pick up
> resultset/result classes that fit the default naming convention and
> stuff them in the right place).
> 
> Right now the tacit assumption (barring explicit renaming by the user)
> in the common case is that the "source_name" is the same as the source
> class name minus the schema class name prefix.
> 
> -- Brandon

To make matters more pointless, every piece of pod under the sun uses
the term "$moniker" when using a result source name in resultset(),
source(), class(), etc.

Whatever we decided to name the accessor, I need to make a grass roots
troll through the various pods and make them gell with each other.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060405/e06c6ecf/attachment.pgp 


More information about the Dbix-class mailing list