The invention belongs to the field of
software engineering design, and particularly relates to a
function as a service implementation method and an unknown type function calling method and
system. An unknown type definition is packaged in a template subclass, then a
base class of a known type is called to a subclass of the unknown type, equivalently, an unknown type function is packaged into a type corresponding to the
base class of the known type, and on the basis that the unknown type function is not defined, by means of the type of the defined
base class, the function of the known type is called to the subclass of the unknown type. According to the method, the packaging definition of the function of the unknown type is generated, and the problem that the unknown type cannot be stored and called is solved, so that the function-as-a-service can be realized under the service program
system realized by the C + + language, the calling efficiency of the subsequent
performance function is improved, and the expandability of
software application is improved; in addition, the method can be compiled and generated into an executive program or a
library, and when function expansion is needed, the
performance function is directly called through the scheme of the invention, so that corresponding function services can be provided, and more efficient and simpler function expansion is realized.