The authors show how mathematical concepts can be used to identify and characterize the modules which can then be used to implement a mathematical method in an object oriented programming language. They propose an alternative way to approach the design challenge, which is called “concept oriented design”. \parThe new design methodology is applied to Petrov-Galerkin methods leading to a class library for both boundary element methods and finite-element methods. As an example the authors implement of the $hp$-finite element method using the library with special attention to the handling of inconsistent meshes.