Position paper for OOPSLA '98 workshop

"Evaluating Object-Oriented Design"

Ways of OOP Teaching

Marianna. Sipos
Dennis G‡bor College for Information Technology
SZçMALK Education and Consulting Center
Department of Programming
H-1115 Budapest, Etele œt 68. Hungary
sipos@okk.szamalk.hu

 

Abstract:

There is not enough time to teach programming in the historical order: Structured Programming, Object Oriented Programming, and Software Developer Devices. In my opinion it is possible to teach Object-Oriented Programming in a 4GL, which makes enjoyable to learn programming and efficient the teaching process. But the implementation language defines how to teach the object-oriented paradigms. I specify one from the possible solutions. This change will lead us to have time to solve bigger problems such as distributed applications, which need really the analysis and design process before the implementation.

Background:

Our Institute is teaching Programming for a lot of Students with different specialization. Mostly the steps of the training are Structured Programming, Object Oriented Programming, and Software Developer Devices. There are two parallel language lines Pascal, Delphi / C, C++, Visual C++. (To teach Structured Programming we use the book E. Angster [1], OOP E. Angster [2], Delphi: E. Baga [3], Visual C++: I have a curriculum.) These are the historical steps, how developed programming. But it is imaginable, we have not enough time to teach the really usable things, which become complicated every year.

Position:

In my opinion it is possible to teach Object-Oriented Programming in a 4GL, which makes enjoyable to learn programming and efficient the teaching process.

I find it is not important which language we use, but we have to use anything. We have to teach the OO thinking, the important paradigms, but the programming language will determine how. Some years ago I taught there is not a big difference to teach OO Programming in Pascal or in C++. But if you want really do it, you will see the difference brings a lot of problems. In my view if you teach a language, you have to teach its way of thinking with it, and it is in this situation quite different. If you use a 4GL to teach the OO paradigm with it, you have to work in another environment perhaps from the first steps. You have to speak about event-driven programming, you are expected to teach the class hierarchy, which is supported by the language, to use the tools, which are provided in the framework, and it is important to acknowledge the patterns, which are provided in the skeleton files.

I agree with Martin L Barrett [4]

The first relationship is class containership, the part-whole relationship where the class that plays the role of ãpartä is also member data.

The second relationship is aggregation. Aggregation is used to set of objects from a common class such as arrays, linked lists or dictionaries.

The third relationship is object association. This is achieved by passing object as a parameter to another objectâs member function.

The fourth relationship is inheritance.

Because the implementation language is in his case C++, but if we use an 4GL it is important to understand the inheritance very soon. What I mean is in such an environment like windows, it is important to use the language supported classes in the first lessons because of the complicated operating system. These classes are commonly abstract, so we have to use inheritance.

In the first lessons when the students want understand the meaning of the object, class and inheritance I do not find it a good solution, teaching these with a big class hierarchy. It was the reason why I taught the OOP basics in standard C++ up to now. It was a good way to understand the basics of OOP, but there was not enough time to teach distributed applications, which is essential today.

The problem is how can you use the language framework and tools from the first steps and write small and transparency programs.

My solution is to chose a simple skeleton program (Dialog based application), and write a simple new class into the project. So you can teach what is a class, an object, the meaning of encapsulation and the simple part-whole relationship. You can speak about the elements of design, the notation of the UML.

As a second step you can teach the simple inheritance with simple non-virtual functions, and speak about protected members. In this step we can speak about constructors and destructors. Now the students are able to understand the skeleton classes, which were provided by the framework, and the relationships among them. UML helps me already in this step.

In the third step I teach runtime binding, the backgrounds of the virtual functions what do abstract method and class mean, and its implementation in the language. Here you can speak about the skeleton projects, which are provided patterns.

In the fourth step comes the aggregation relationship, with arrays, linked lists dictionaries and its implementation with simple or template classes.

In the fifth step I teach the object association.

I implement this program with Phone classes, which have a simple interface class with push buttons. Everybody knows how a Phone works, so it is easy to understand the problem. Later they give me the possibility to teach the synchronous and asynchronous message handling and the component based distributed applications. I use, of course, other samples too which fit into the current material.

In my opinion it is better to teach the fundamentals with small exercises, not with big problem which is solved step by step. I think we have to solve bigger problems from the real world later. In this problems you can better verify the need of analyzing and designing and to teach how. In my point of view the best order is, at first teach the concepts throw simple exercises, then comes a bigger problem step by step with analyzing and design [5] and finally to do it in team. (It is now out of time.)

Comparison:

I read on the Internet the two chapters from the book of Rick Mercer [6], which speaks about a real life problem that needs analysis and design. It is very interesting! It seems the students would learn how to make analysis and design themselves from their experience. In our college it is a rare situation that an "object expert" is in the group, and there are students who know nothing about vectors, and do not know the difference between object and class after the first lesson. This is an extreme situation for me! I can not imagine how it works! We write out the minimal requirements for the applicants. I determine an order what I teach, and I choose such examples, that need only the already learned materials. Analysis and design are not the first steps. In Rick Mercer's book it is the 12-th chapter too. I find very interesting looking for the solution in a good picked team, where the members help themselves. I would like to see how it works in reality perhaps I could use some elements of it in my work, to make the lessons more enjoyable. In mathematics I used it, if I found the solution myself, I did not have to learn it. I am ready to change my mind, if I find a really good solution. This solution saves me some time, which I am always short of. In this way we have to pay big attention to the concepts clear definition.

It was interesting to read Kerstin Voigt [7] who wrote from the other site of the problem. I would like to teach 4GL sooner, she has experiences about teaching OO for students, who are complete novices to OO, and possibly computer programming in general. This is an excellent idea that turns the programming teaching upside down.

 

References:

[1] Erzsebet Angster: Programming Textbook I.& II. 1995.

[2] Erzsebet Angster: The Basics of Object-Oriented Designing and Programming. 1997.

[3] Edit Baga: Delphi in a different manner 1998.

[4] Martin L Barrett: "A Sequence of Class Relations" OOPSLA'96 workshop, 1996. http:/ /www.bk.psu.edu/faculty/mercer/design/03Marty_Barret.htm

[5] Mastering Distributed Application Design Using Microsoft Visual Studio, Microsoft, 1998.

[6] Rick Mercer, Franklin, Beedle, and Associates: Computing Fundamentals with C++. 1995. http://www.bk.psu. edu/faculty/mercer/design/98SIGCSE.html

[7] Kerstin Voigt, "Wholistic Introduction to Object Design" OOPSLA'97 workshop,1997. http://www.c sci.csusb.edu/www/voigt/oopsla97_submit.html

 

 Biography:

Associate Professor, Dennis G‡bor College, 1996-present

Courses taught include: Programming I. and II., Object-Oriented Programming both Pascal and C++, Visual C++.

Ph. D. student, Technical-training Pedagogy, Technical University Budapest, 1998-present

Courses taught include: Mathematics, Informationtechnic.