Abstract:Based on the object-oriented programming method, the knowledge base of ground and foundation code have been constructed by using the object oriented programming language C++. On the one hand, it is so easy to maintain and update the code base. On the other hand, different programs can use the code base. By the inheritance and the polymorphism, the code base can bring forward the uniform interface. The hierarchy of class base is described, then, the definition and the usage of the class of ground, the class of foundation design, the class of parameter and the class of section design are discussed. The knowledge base can be used in the foundation scheme expert system or the foundation design decision support system.