You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Jens Geyer <je...@hotmail.com> on 2011/08/03 03:49:01 UTC
Thrift class names
I'd like to know, if there are any "official" suggestions for the namings of
Thrift classes in general?
Background is, that not all languages support namespaces and the original
names (I refer to the C++ implementation) might create naming conflicts with
other environments. Currently I avoid that by renaming the classes in my
case, I add an additional "Thrift" to the name, so that (example)
TBinaryProtocol becomes TThriftBinaryProtocol.
Is this in line with the guidelines (if any), or are there any other
requirements or suggestions?
Thanks + regards,
JensG
Re: Thrift class names
Posted by Jens Geyer <je...@hotmail.com>.
Ok, it seems there are no rules and we're free to make our own.
Thanks,
JensG
--------------------------------------------------
From: "Jens Geyer" <je...@hotmail.com>
Sent: Friday, August 05, 2011 11:37 AM
To: <de...@thrift.apache.org>
Subject: Re: Thrift class names
> Hello Roger,
>
> thanks for your answer. Unfortunately, it slightly misses the point.
>
> I wrote:
>
>>> Background is, that not all languages support namespaces [...]
>
> You answered
>
>> I recommend to use the namespace feature, it's supported by nearly every
>> language
>
> I fully agree with your recommendation, but the problem we're faced with
> is the "nearly". As I already pointed out and as "nearly" implies, not
> all languages do this. Therefore, my question was, what the
> recommendations are in such cases?
>
> Example: Object Pascal.
>
> The only namespace-alike concept we have there, are Units. However, if we
> are going to do this, then we either have to put everything into one
> source file per namespace (!) or do some obscure things with includes
> (which are although possible not very common in pascal, thus the
> "obscure") just to satisfy the namespace requirement, but introducing many
> other issues, such as debugging problems, etc. So IMHO this is not the
> path we should follow. And that's why I asked for alternatives.
>
>
> Thanks + regards,
> JensG
>
>
> --------------------------------------------------
> From: "Roger Meier" <ro...@bufferoverflow.ch>
> Sent: Wednesday, August 03, 2011 8:58 PM
> To: <de...@thrift.apache.org>
> Subject: AW: Thrift class names
>
>> I recommend to use the namespace feature, it's supported by nearly every
>> language
>> e.g.
>> namespace java org.example.mypackage
>> namespace cpp example.mypackage
>>
>> -Roger
>>> -----Ursprüngliche Nachricht-----
>>> Von: Jens Geyer [mailto:jensgeyer@hotmail.com]
>>> Gesendet: Mittwoch, 3. August 2011 03:49
>>> An: dev@thrift.apache.org
>>> Betreff: Thrift class names
>>>
>>> I'd like to know, if there are any "official" suggestions for the
>>> namings
>> of
>>> Thrift classes in general?
>>>
>>> Background is, that not all languages support namespaces and the
>>> original
>>> names (I refer to the C++ implementation) might create naming conflicts
>>> with other environments. Currently I avoid that by renaming the classes
>>> in
>>> my case, I add an additional "Thrift" to the name, so that (example)
>>> TBinaryProtocol becomes TThriftBinaryProtocol.
>>>
>>> Is this in line with the guidelines (if any), or are there any other
>> requirements
>>> or suggestions?
>>>
>>> Thanks + regards,
>>> JensG
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
Re: Thrift class names
Posted by Jens Geyer <je...@hotmail.com>.
Hello Roger,
thanks for your answer. Unfortunately, it slightly misses the point.
I wrote:
>> Background is, that not all languages support namespaces [...]
You answered
> I recommend to use the namespace feature, it's supported by nearly every
> language
I fully agree with your recommendation, but the problem we're faced with is
the "nearly". As I already pointed out and as "nearly" implies, not all
languages do this. Therefore, my question was, what the recommendations are
in such cases?
Example: Object Pascal.
The only namespace-alike concept we have there, are Units. However, if we
are going to do this, then we either have to put everything into one source
file per namespace (!) or do some obscure things with includes (which are
although possible not very common in pascal, thus the "obscure") just to
satisfy the namespace requirement, but introducing many other issues, such
as debugging problems, etc. So IMHO this is not the path we should follow.
And that's why I asked for alternatives.
Thanks + regards,
JensG
--------------------------------------------------
From: "Roger Meier" <ro...@bufferoverflow.ch>
Sent: Wednesday, August 03, 2011 8:58 PM
To: <de...@thrift.apache.org>
Subject: AW: Thrift class names
> I recommend to use the namespace feature, it's supported by nearly every
> language
> e.g.
> namespace java org.example.mypackage
> namespace cpp example.mypackage
>
> -Roger
>> -----Ursprüngliche Nachricht-----
>> Von: Jens Geyer [mailto:jensgeyer@hotmail.com]
>> Gesendet: Mittwoch, 3. August 2011 03:49
>> An: dev@thrift.apache.org
>> Betreff: Thrift class names
>>
>> I'd like to know, if there are any "official" suggestions for the namings
> of
>> Thrift classes in general?
>>
>> Background is, that not all languages support namespaces and the original
>> names (I refer to the C++ implementation) might create naming conflicts
>> with other environments. Currently I avoid that by renaming the classes
>> in
>> my case, I add an additional "Thrift" to the name, so that (example)
>> TBinaryProtocol becomes TThriftBinaryProtocol.
>>
>> Is this in line with the guidelines (if any), or are there any other
> requirements
>> or suggestions?
>>
>> Thanks + regards,
>> JensG
>>
>>
>>
>>
>>
>
>
>
AW: Thrift class names
Posted by Roger Meier <ro...@bufferoverflow.ch>.
I recommend to use the namespace feature, it's supported by nearly every
language
e.g.
namespace java org.example.mypackage
namespace cpp example.mypackage
-Roger
> -----Ursprüngliche Nachricht-----
> Von: Jens Geyer [mailto:jensgeyer@hotmail.com]
> Gesendet: Mittwoch, 3. August 2011 03:49
> An: dev@thrift.apache.org
> Betreff: Thrift class names
>
> I'd like to know, if there are any "official" suggestions for the namings
of
> Thrift classes in general?
>
> Background is, that not all languages support namespaces and the original
> names (I refer to the C++ implementation) might create naming conflicts
> with other environments. Currently I avoid that by renaming the classes in
> my case, I add an additional "Thrift" to the name, so that (example)
> TBinaryProtocol becomes TThriftBinaryProtocol.
>
> Is this in line with the guidelines (if any), or are there any other
requirements
> or suggestions?
>
> Thanks + regards,
> JensG
>
>
>
>
>