A question about OOP in Fortran?
- From: li.simula@xxxxxxxxx
- Date: Fri, 29 Jun 2007 09:17:05 -0700
I should use Fortran for some special reason (I have some old codes
can be referenced) and I want to program my Fortran codes in
oop(object-oriented program) strategy.
In C++, you can use a base class pointer in main program to invoke the
fuctions in derived class. But in Fortran, the derived class is
obtained by "use" base class(type or module containing the type), and
we known that the "use" is only feasible in a one-direction way(i.e.
if A is already use B, then B can't use A) . So, you can't use base
class in main program and then invoke functions in derived class in
the main program. You can only directly use derived class in main
program and then invoke functions in derived class. But I have too
many many derived classes!
How can fortran simulate the C++ 's this behavior (in C++, the
behavior, I think, is in two-direction way)???
Note: I have read some literatures such as professor Akin etc., Decyk
etc., but I think their method is not easy to use if the program is
more complex which has several levels of derived classes.
Any suggestion???
.
- Follow-Ups:
- Re: A question about OOP in Fortran?
- From: Jon Harrop
- Re: A question about OOP in Fortran?
- Prev by Date: Re: Need Help: compiling old Fortran program
- Next by Date: Re: SAVE
- Previous by thread: [ ] for arrays and co-arrays
- Next by thread: Re: A question about OOP in Fortran?
- Index(es):
Relevant Pages
|