Teaching object-oriented concepts and design with Eclipse
Object-oriented software development is a subject area difficult to
teach, especially to beginners. They face a lot of abstraction and
(from a beginners point of view) isolated topics, such as the syntax
and semantics of a programming language, the functionality of a
software development environment and the basic object-oriented
concepts. Although many professionals in education believe in the
"object first" approach as the best method of introducing
object-oriented concepts, there is no common agreement on how to start
such courses. In 2001 the
LIFE³ project [LIFE], funded by the education
ministry of North Rhine Westphalia, Germany, started as a cooperation
of two research groups at the University of Paderborn and several
secondary schools in Germany to face this problem. As the outcome of
this one year project a learning environment was developed based on
the
Fujaba Tool Suite [FUJABA].
The Fujaba Tool Suite is developed as an open source project at our
research group.
Our goal is to provide an integrated teaching environment based on
Eclipse for secondary
schools and first year university courses. It should assist teaching
object-oriented technology, design patterns and the syntax and
semantics of a programming language - here Java.
Fujaba LIFE³ Environment
The Fujaba LIFE³ approach uses only a subset of the UML. This subset
consists of UML class, activity and collaboration diagrams. Fujaba
LIFE³ supports Story Driven Modeling (SDM) [FNTZ98] which enables the
user to specify complete method bodies with UML activity diagrams
where activities are described by extended UML collaboration
diagrams. This combination of an activity diagram and extended
collaboration diagrams is called story diagram. The whole software
design process from structural design to implementation of methods is
done in a graphical way which has been shown in a case study to be
easy to understand and learn [NS02, SMNS03].
Students following the SDM-process specify complete applications
without being confronted with the syntactical details of a textual
object-oriented programming language. So they can concentrate on
learning object-oriented concepts. In addition, the diagram editors
are restrictive and syntax driven. Showing methods as story diagrams
also helps students to conceptualize methods as means to operate on
object structures. Note that this visual description of the classes
and methods is completely independent from programming
languages. Especially the description of the method bodies by story
diagrams differs from most UML tools, where activities usually are
specified by programming language specific code.
Fujaba LIFE³ furthermore supports automatic code generation from the
design. The generated code includes classes with their inter class
relationships such as inheritance, references and associations as well
as their attributes and methods. Method bodies are generated from
their story diagrams. The result is a fully compilable and executable
source code. The generated source code is even human readable and easy
to understand. Note that code generation can be done in each step of
the design phase. Code generators can synthesize code for any
object-oriented programming language. We already implemented a code
generator for Java.
Our code generation supports teaching a programming language, since
the generated code is closely related to the design. Therefore
students can compare their own visual design to the generated code and
learn the syntax and semantics of a programming language by examples.
Design Patterns
After basic object-oriented concepts the next step is to teach
students (good) software design. At our research group several
lectures addressing design patterns [GHJV95] have been given and will
be held in the future. Design patterns represent good design solutions
to recurring problems. They lead to understandable and extensible,
i. e. easily changeable, designs and consequently to high quality
software. In our lectures we experienced that design patterns are
well-suited for teaching students good design. Therefore the proposal
aims at enabling students to easily incorporate design patterns into
their designs by means of a pattern editor. Such a pattern editor will
enable students to actively experiment with design patterns. Thus they
will be able to add practical experience with design patterns to the
theoretical knowledge offered by the lectures.
In a first step, design patterns have to be specified. A design
pattern consists of a structural part which defines classes and
structural relationships, e. g. associations, between them and a
behavioral part which defines how the classes interact. The design
pattern editor will use class diagrams for the specification of the
structural part of a pattern. The behavioral part, i. e. the methods,
will be specified with story diagrams. The editor will allow to load,
save, and create new pattern specifications.
The second step is the instantiation of a design pattern, i. e. its
integration into the actual design of a software system. Therefore the
pattern editor will allow to choose a previously specified pattern for
instantiation. A design pattern defines classes, associations, and
methods some of which may already exist in the actual design. The
pattern editor will enable users to assign existing design elements to
elements specified by the pattern. The remaining elements of the
pattern are then created during the instantiation. Thus the editor
allows the seamless integration of a pattern into an existing design.
The Eclipse Plug-In
The extension of Eclipse by a plug-in supporting class diagrams and
story diagrams enables students to learn object-oriented
concepts. Teaching starts with lessons about classes and instances,
followed by dynamic runtime behavior. Students will learn
object-oriented thinking and programming using an easy to understand
visual language which provides automatic generation of executable Java
code. The plug-in further supports design pattern specification and
instantiation through a pattern editor. Thus, in later stages of
education design patterns can be employed to teach good software
design. When learning a programming language, students are able to
generate code from the class and story diagram specifications and
modify it using Eclipse as IDE. Therefore they do not have to change
to and become acquainted with a new platform.
References
[FNTZ98] T. Fischer, J. Niere, L. Torunski, and A. Zuendorf. Story
Diagrams: A new Graph Rewrite Language based on the Unified Modeling
Language. In Proceedings of the 6th International Workshop on Theory
and Application of Graph Transformation (TAGT), Paderborn,
Germany. G. Engels and G. Rozenberg (editors), LNCS 1764, Springer
Verlag, November 1998.
[FUJABA] The Fujaba Tool Suite. Online at http://www.fujaba.de.
[GHJV95] E. Gamma, R. Helm, R. Johnson and J. Vlissides. Design
Patterns. Addison-Wesley, Reading, MA, USA, 1995.
[LIFE] The LIFE³ Project. Online at http://life.uni-paderborn.de (in German).
[NS02] J. Niere and C. Schulte, Thinking in Object Structures:
Teaching Modelling in Secondary Schools, Proceedings of the ECOOP
Workshop on Pedagogies and Tools for Learning Object-Oriented
Concepts, Malaga, Spain, LNCS 2548, Springer-Verlag, June 2002.
[SMNS03] C. Schulte, J. Magenheim, J. Niere, and W. Schaefer, Thinking
in Objects and their Collaboration: Introducing Object-Oriented
Technology, Journal of Computer Science Education, Vol. 13, No.4,
pp. 269-288, Swets & Zeitlinger Publishers, December 2003.