SCALES: Learning Multimedia in a Mixed-Paradigm (original) (raw)

Foreword When planning a Java programming course in a school or even in a business context, the reduced number of hours available often has to be taken into account. A program that includes all aspects of the language is not feasible (for a much more extensive approach, from the syntactic point of view and for the topics dealt with, see note 3), but rather topics must be chosen with the aim of involving and also entertaining users, and hopefully encouraging to study the subject in greater depth in the future. Here we put forward a"possible method" (one of many) that has been repeatedly tested on many students. The method includes the advice to students to use the help and online help often (instructions on how to do this will be provided) to encourage autonomy in those who write programs from the outset. At the end, you will have learned to write some programs and be ready to start creating other projects (not exclusively in Java). The cognitive structures transmitted during the course are first and foremost linguistic structures. Noam Chomsky's Generative Transformational Grammar is the basic text from which the initial idea of the method started. In a 2001 interview, Dijkstra stated a desire for "elegance", whereby the correct approach would be to process thoughts mentally, rather than attempt to render them until they are complete. Here we can add that the constant correct use of formal language can contribute to the correct formulation of thoughts. If then, as in the case of Java, we are dealing with an object-oriented language, the syntactic structure contributes greatly to the organisation of thought. A linguistic model must therefore be proposed at the same time as the problem to be solved is presented, whether the problem is mathematical or otherwise. It is preferable to first analyse the algorithm in a discussion and then immediately formalise it in Java: no metalanguages or intermediate formal languages are needed as it could be misleading to isolate the problem from its final "linguistic solution". Finally, structured and functioning examples containing different linguistic constructs in relation to each other are analysed, and in this way more information is communicated to users than when single separate syntactic examples are used. Introduction From a technical point of view, every program in Java can be described as follows • It consists essentially of classes: the class is the linguistic unit that contains data (variables or properties) and operations (methods) on the data and it is recognisable because its name is preceded by the keyword class; • The classes are divided into packages, which group the classes according to their functionality (program start, graphics, mathematical or other operations and so on); • The classes are mutually related through two possible types of relationship: inheritance or composition; • Each class is given a constructor, a particular method that has the same name as the class, which is activated every time a class is created (with the instruction new) and contains all the instructions that must be executed first and only once each time the class is instantiated (created); • The call or activation of a class method by a method of another class can occur every time two classes are related (through inheritance or composition). If the method is public, the call can also be made from a class belonging to another package. Typically, when the program starts with a graphical interface (window), data is usually entered in the graphics package (frame) and this data is then processed by methods belonging to the classes of another package, whose name (mathematics, dictionaries, etc.) will be representative of the type of operations it contains; • At this point we provide the syntax tools that allow you to write any program as a set of classes in relation to each other, containing both data and operations on the data (see yes concept algebraic structure); • We provide information on the important concept of data encapsulation and introduce the use of the keyword private, thanks to which the data of a class are not directly accessible and modifiable by the operations of another class, for security reasons; • Use of get methods are introduced, followed by some setmethods. • We explain the fundamental concept of listener, which allows the program to interact with the operating system. • It should be noted that the language has many pre-defined class packages, which can be used by means of import instructions. • The imported classes that are often used include those that implement the basic data structures of computing: ArrayList, List, Hashmap, Map. In all the dictionaries created in the text examples, the HashMapis implemented, where the clear and constructive implementation of the function concept can be seen. Once the syntactic rules of language and the fundamental principles of object-oriented programminghave been learnt, with reference to examples written correctly in Java, the first step is to start writing programs by modifying or extending the available code, then, in the second step, code is created directly. The first step should not be omitted as, before starting to speak or write in a new language, it is essential to hear it spoken and see it written by those who have already mastered it. Learning syntactic rules is important but not sufficient, not even for a formal language. At the beginning the code writing method may involve a certain degree of automatism, for example a second button is created by observing how the first one was created, a class is instantiated and then a method is recalled, taking an example from a similar operation, and so on. It is in fact a constructive automatism, which helps to fix the essential basic linguistic models in the mind, which will then allow creative code to be generated later on. The correction of projects written by the students must be constant and immediate, in order to allow them to interact in a continuous manner with the code, which should lead to working programs as quickly as possible. When possible, hours of lectures can be reinforced by e-learning activities, thus using learning techniques in blended learning . Type 1 information containers For years we have called them e-books, even if the projects do not fully correspond to what is generally known as ebooks . Students create hundreds of them each year, choosing the multilingual, heterogeneous contents that most interest them . When they create these information containers that are interactive and can always be modified, they come into contact with very important aspects of language, including, not in order of importance: • Interfaces • Inheritance • XML files • String management • Redefinition of the paintComponent () method and use of the device context • Uploading images as wallpapers • Creation of multiple panels • Scroll management • HashMap, list, ArrayList and other Collections with parameterised types • The BufferedImage class and the getRGB () method with practical applications such as geographic maps (selection of a region by colour, etc.) • Use of the coordinates of an image to identify some of its parts (identification of planets and so on) • Links to websites through the URL and URI classes Finally arriving at the creation of a jar executable from any project, which can be run outside of an integrated environment and used on any computer on which the Java run-time has been installed. From a mathematical point of view, important concepts such as those of function and of algebraic structure can be seen applied in practice. As all this may be contained within a single program, we will be able to document it in detail. In any case, bringing together many significant aspects of language in one project helps to understand and remember them more easily.