This article investigates software engineering techniques for designing and reengineering knowledge-based system generators, focusing on inference engines and domain specific languages. Indeed, software development of knowledge-based systems is a difficult task. We choose a software engineering approach to favor code reuse, evolution, and maintenance. We propose a software platform named Lama to design the different elements necessary to produce a knowledge-based system. This platform offers software toolkits (mainly component frameworks) to build interfaces, inference engines, and expert languages. We have used the platform to build several KBS generators for various tasks (planning, classification, model calibration) in different domains. The approach appears well fitted to knowledge-based system generators; it allows developers a significant gain in time, as well as it improves software readability and safeness.