The development of object thinking in students


    For a long time, teachers have been faced with the task of teaching students to think objectively. The task is difficult. It is difficult to explain such things, you can only try to show it with examples. And even then, these examples, most often do not give an idea of ​​what the teacher wants.

    Today, on the tape, I offered second-year students an interesting task for the development of object thinking. Details further.

    The task was as follows. There is a man and a cinema. A person in a movie theater can perform various actions. For example, in cinemas, there are very often slot machines and people can play them. This implies the following model: You understand that the model can be further detailed! Create a more accurate hierarchy, etc.

    The task of students is to create a model that allows to realize as many processes as possible in a movie theater. At the same time, no strict requirements were imposed on the model. Students could do it anywhere, whatever. Not adhered to any notations. An object has an action and has properties. At the same time, actions and properties can be described in any language. There was no emphasis on the correctness of the model, the correctness of inheritance, etc.

    The result exceeded my expectations. :-) Students with pleasure joined in solving the problem and offered very interesting and different models! For example, one girl made a very detailed model. Where a visitor could say hello to any other visitor, he could lose a badge or get drunk in a bar, and pee in the toilet by and watchman scolded him for it! :-) Others delved into the details of the cinema, while others described very casinos in the cinema, with the ability to play poker and even possible combinations of this game. :-) And one guy realized the command pattern, not even suspecting the existence of it. :-)

    In general, it was very interesting. :-)

    After such an assignment, many students understood the essence of inheritance using the example of a seller. More precisely, they themselves have come to this. They realized that both the bartender, the cashier, and the grandmother in the toilet are all sellers and that they can all sell something. And their model, nice for me, was full of inheritance of specific sellers from the base seller. :-)

    In the next classes I want to continue such trainings, but each time complicate the task. For example, next time, we will already describe properties and methods rigidly. There is a property, it has a type. There is a method, it has a return type and parameters of a certain type. Next, we begin to draw models in UML notation and focus on proper inheritance, and then learn how to extract interfaces and understand what encapsulation is.

    In general, I am waiting for your opinion, advice and suggestions. :-) I'm in a very good mood today! :-)

    Also popular now: