Teaching about Creational Design Patterns – General Implementations of an Algebraic Structure Virginia Niculescu Department of Computer Science Babe¸ s-Bolyai University, Cluj-Napoca E-mail: vniculescu@cs.ubbcluj.ro Abstract Teaching about design patterns is not easy, especially for the students that don’t have so much experience in OOP. Hence, finding example from well-known arias is very important. Usually, students in Computer Science also learn a lot of Mathematics, and Algebra is a field that is normally very well treated. This article presents an example that deals with algebraic structures and uses creational design patterns. The possibility of constructing a general polynomial built over any kind of algebraic field (K, +, *) is discussed. In order to work with polynomials that have different coefficient types: real, complex, etc., the type of a polynomial coefficient is consider to be an abstract type – FieldElem. Three creational design patterns are discussed and advantages of using them are also analyzed. Patterns are used for the creation of the special values of the coefficients: zero and one. The example helps the students to learn about creational design patterns, without creating big applications. This leads to an easy and well understanding of the concepts. 1 Introduction Teaching about design patterns is not easy, especially for the students that don’t have so much ex- perience in OOP. Hence, finding example from well-known arias is very important. Usually, students in Computer Science also learn a lot of Mathematics, and Algebra is a field that is normally very well treated. This article presents an example that deals with algebraic structures and uses creational design patterns. A polynomial can be built over any kind of algebraic field (K, +, *), and usually we have to define a different class that implements the common operations with polynomials, for every such field. Our goal is to define a general implementation of a polynomial, which can be used for different applications with polynomials, with different coefficient types. 2 Creational Design Patterns Creational design patterns abstract the instantiation process. They are based on composition and inheritance. They allow us to make the pass from the hardcoding of a fixed set of behaviors towards 1