Abstract

Although the high-performance computing (HPC) community increasingly embraces object-oriented programming (OOP), most HPC OOP projects employ the C++ programming language. Until recently, Fortran programmers interested in mining the benefits of OOP had to emulate OOP in Fortran 90/95. The advent of widespread compiler support for Fortran 2003 now facilitates explicitly constructing object-oriented class hierarchies via inheritance and leveraging related class behaviors such as dynamic polymorphism. Although C++ allows a class to inherit from multiple parent classes, Fortran and several other OOP languages restrict or prohibit explicit multiple inheritance relationships in order to circumvent several pitfalls associated with them. Nonetheless, what appears as an intrinsic feature in one language can be modeled as a user-constructed design pattern in another language. The present paper demonstrates how to apply the facade structural design pattern to support a multiple inheritance class relationship in Fortran 2003. The design unleashes the power of the associated class relationships for modeling complicated data structures yet avoids the ambiguities that plague some multiple inheritance scenarios.

Highlights

  • Object-oriented programming originated in the late 1960s with the invention of the Simula 67 computer programming language

  • The Fortran implementation for emulating multiple inheritance with the previously described model is shown in Listings 1–4

  • The discussed model presents a safe solution for emulating multiple inheritance in Fortran 2003/2008

Read more

Summary

Introduction

Object-oriented programming originated in the late 1960s with the invention of the Simula 67 computer programming language. Since the early 1980s several modern programming languages, including C++, Java, Python, and Ruby, have been developed with explicit support for OOP from their inception. Several older languages, including Ada, BASIC, Lisp, Pascal, and Fortran, have evolved to support OOP in their modern versions [1]. Of these two groups, Fortran and C++ find the most frequent use in high-performance computing [2]. The recent advent of widespread compiler support for the OOP features of the Fortran 2003 and 2008 standards offers an exciting opportunity to develop and promulgate idioms for expressing OOP concepts in Fortran [3]. The current article focuses on one such idiom: multiple inheritance

Methods
Results
Discussion
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call