[ 
https://issues.apache.org/jira/browse/THRIFT-5154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17068135#comment-17068135
 ] 

Jens Geyer commented on THRIFT-5154:
------------------------------------

It may be worth mentioning, that the IIDs are not constant across multiple 
compiler runs. This is perfectly ok, since this is not really necessary. As 
long as the interface is only used within a module, it is important that there 
is an IID, but not what the exact value is.

If, in contrast, the interface would be handed out outside the module 
boundaries, then one could argue this would be a problem indeed, because all 
modules would need to be compiled using the exact same source code, or there is 
no compatibility.

However, there is a number of good reasons why this claim does not hold and/or 
is impracticable:

a) In order to emit a constant IID for a given interface, the compiler must be 
absolutely sure that the interface and all types used by it are 100% binary 
compatible. Currently such kind of deep checks is not implemented, hence - 
given the current circumstances -  the compiler /should/ indeed generate 
different IIDs for each compiler run simply to prevent against /potential/ or 
manifest incompatibilities. It would be much worse if the compiler emits a 
constant IID even if the interface is not binary compatible anymore, so 
emitting a fresh IID is the safer bet.

b) Handing out Thrift-generated interfaces across module boundaries did not 
work before this patch either, since all interfaces have the implicit default 
of GUID_NULL and are therefore completely indistinguishable. So the 
compatibility argument does not hold at all.

 

> Generate interface IDs (IID) for Windows platforms
> --------------------------------------------------
>
>                 Key: THRIFT-5154
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5154
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Delphi - Compiler
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Although Delphi allows for interfaces without an assigned IID (or GUID), 
> certain operations do indeed require a IID, such as 
> {{[SysUtils.Supports()|http://docwiki.embarcadero.com/Libraries/Rio/en/System.SysUtils.Supports]}}.
> Hence, to support such "Delphi interface best practices" it would be 
> extremely helpful if the generator could create a valid IID at least for 
> Windows platforms (which is Delphi's natural target and development platform).
> The code should be held easily expandable to support other platforms in the 
> future.
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to