interface-implementation separation 
Author Message
 interface-implementation separation

Hi all,

the topic of this post was discussed earlier in c.l.f [1] and possible
solutions were shown [2].

In 1997, it was suggested to have types and interfaces in one file and
external routines as the implementation of those interfaces in another
file.

Did different solutions or coding patterns to solve the problem of
separating interface and implementation in F90/F95 emerge since then?

Regards
        Daniel

[1]
http://www.*-*-*.com/
(Van Snyder, reply 10)
[2]
http://www.*-*-*.com/
(Artur Swietanowski, reply 19)



Fri, 15 May 2009 16:34:41 GMT  
 interface-implementation separation
Hi,

Quote:

> the topic of this post was discussed earlier in c.l.f [1] and possible
> solutions were shown [2].
> In 1997, it was suggested to have types and interfaces in one file and
> external routines as the implementation of those interfaces in another
> file.

I think this is the only effective solution even today.

Quote:
> Did different solutions or coding patterns to solve the problem of
> separating interface and implementation in F90/F95 emerge since then?

Well, submodules are what you want. But to my knowledge not a single
compiler supports them up to now.
They are part of "ISO/IEC TR 19767:2005 fortran - Enhanced Module
Facilities".
See: ftp://ftp.nag.co.uk/sc22wg5/N1601-N1650/N1602.pdf

They are also part of the current draft of Fortran 2008 (06-007r1).

As most compiler vendors will probably first concentrate on Fortran
2003 before going beyond (TR, F2008), you most likely have to wait a
few years before you see this feature. (You could lobby your vendor if
you need it earlier.)

Tobias



Fri, 15 May 2009 17:22:43 GMT  
 interface-implementation separation

Quote:

> > In 1997, it was suggested to have types and interfaces in one file and
> > external routines as the implementation of those interfaces in another
> > file.

> I think this is the only effective solution even today.
> > Did different solutions or coding patterns to solve the problem of
> > separating interface and implementation in F90/F95 emerge since then?

> Well, submodules are what you want. [...]
> See: ftp://ftp.nag.co.uk/sc22wg5/N1601-N1650/N1602.pdf

Tobias,

thanks for the link. I'm not in a hurry with this. If no other
solution presents itself, the above will do. Did not want to
miss any recent development :)

Regards
        Daniel



Fri, 15 May 2009 17:46:17 GMT  
 interface-implementation separation

Quote:

> Well, submodules are what you want. But to my knowledge not a single
> compiler supports them up to now
...
> As most compiler vendors will probably first concentrate on Fortran
> 2003 before going beyond (TR, F2008), you most likely have to wait a
> few years before you see this feature. (You could lobby your vendor if
> you need it earlier.)

While that sounds sensible, I have heard several vendor reps say
otherwise - that they have enough customer demand for submodules that
they intend to add that functionality before completing some parts of
f2003 (such as parameterized derived types, which apparently are among
the trickier things for implementors). Count that as hearsay; I heard
this in casual conversation rather than as any inside information, and
I'm sure it didn't count as anything like a commitment. So if you are
hot for it earlier, yes, it might be worth lobbying your vendor. In
fact, it might be worth more specifically because it sounds like you
wouldn't be the only customer asking for it.

--
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain



Sat, 16 May 2009 00:24:32 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. COM: Interface Implementation question

2. Looking for Interface Inheritance Implementation

3. newbie question: implementation inheritance and interface specifications in Haskell 98

4. technical implementation details in language interface

5. Separating Interface and Implementation

6. Implementations of C function interface?

7. Program to an interface, not an implementation

8. Inheritance: Interface vs Implementation (was: Questions on inheritance)

9. Model-View separation in WindowBuilder

10. Fields with no separation Chars

11. Are Design by Contract and the command -query separation principle a load of rubbish

12. Orthogonal Persistence and Command-Query Separation

 

 
Powered by phpBB® Forum Software