Is there a widely used naming convention for Delphi units that contain only interface definitions?
I'm asking specifically if anything exists that has become a widespread convention in the Delphi community. I am not asking for your opinion on what is a good convention, or even necessarily what you use personally. Your answer needs to demonstrate that what you describe is a widespread convention by saying where you've seen it used.
To illustrate the question more clearly I'll describe my organisation's homegrown convention and why I'm not satisfied with it: If a class is called TFoo
, then its unit would be called uFoo
. An interface implemented by TFoo
would probably be called IFoo
, but obviously I can't save this unit as iFoo
because the interface already has that name.
In other words, I'm trying to complete this grid:
+--------+---------------+---------------+
! ! Class ! Interface !
+--------+---------------+---------------+
! ! ! !
! Name ! TFoo ! IFoo !
! ! ! !
+--------+---------------+---------------+
! ! ! !
! File ! uFoo.pas ! ????.pas !
! ! ! !
+--------+---------------+---------------+
Updated on 19 March 2014 to make it clearer that I'm looking for fact-based (not opinion-based) answers.
I would use Foo_Intf for the file name. I have seen RemObjects use it when it automatically generates units. I think the programmers I worked with picked it up from RO and I picked it up from them. It makes sense to me since it makes finding the interfaces easy.
I would use uFooAPI.pas
for the unit declaring the abstract interface. It's my own convention.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With