[Uml-devel] inlines

P. Fleury fleury at users.sourceforge.net
Tue Oct 22 00:10:03 UTC 2002


tomas.walch at se.transport.bombardier.com wrote:

>>Is it just me or is inline code really really evil?  Changing something in
>>a header file is painful enough in terms of having to recompile large
>>chunks of the program and inline code just increases the frequency of
>>changes to the header files.  Makes me quite worked up so it does.
>>One day I'll probably get so annoyed that I'll remove them all from
>>Umbrello, probably the same day I remove all methods that start with an
>>upper case letter.  So there.
>>    
>>
>
>The reason inlines are there is because the C programmers in the old days (like
>ten years ago...) were using macros to elimit the overhead of making function
>calls for small operations, and since Bjarne thought macros were bad, inlines
>were born as kind of a compromise. If C++ was to take off it was necessary to
>get enough C programmers to switch language. But today that small overhead isn´t
>a problem and as you correctly point out inlines just create high dependencies
>beween the files.
>
>/Tomas Walch
>
>  
>
Well, another reason is the possibility for the compiler to really 
optimize the produced code (as it sees it all and can optimized across 
the inlined method boundary) without sacrificing the accessor design 
(you communicate with an object only through methods). Inline methods 
are then typically used when the method is very very short. In some 
cases, the different in speed execution can be an order of magnitude, 
from my experience. At that stage of the project, source files did not 
change a lot, so their dependencies were not a big deal. Merely putting 
the method definition back into the header file.

However, I agree that is a deep-in-the-implementation-step thing, which 
hardly should be of concern during the design of a system, and hence of 
very little concern at the moment for umbrello.

Are there any specifications to descirbe these parts of the design ? 
Which would make basically another tool, using an XMI file, being able 
to export code in a few programming languages, where one can twist the 
output parameters. I feel that there will be no one-size-fits-all in 
code exporting from XMI, and that this is a big chunk. A long time ago, 
we were talking about dia2code, which can read an XMI file, then output 
code. Now we have XMI. Can we use it ?

My 2 yen contrib...
--Pascal





More information about the umbrello-devel mailing list