Recent work in Artificial Intelligence is exploring the use of formal ontologies as a way of specifying content-specific agreements for the sharing and reuse of knowledge among software entities. We take an engineering perspective on the development of such ontologies. Formal ontologies are viewed as designed artifacts, formulated for specific purposes and evaluated against objective design criteria. We describe the role of ontologies in supporting knowledge sharing activities, and then present a set of criteria to guide the development of ontologies for these purposes. We show how these criteria are applied in case studies from the design of ontologies for engineering mathematics and bibliographic data. The rationale for selected design decisions in these ontologies is presented. Alternative representations are compared and evaluated against the general criteria. In particular, the case studies illustrate the notions of encoding bias and ontological overcommitment and suggest ways to avoid them in the design of ontologies for knowledge sharing.