Implementation of Model View Controller Architecture in Object Oriented Programming Learning

—This study aims to provide an overview of the application of software design patterns, namely Model View Controller (MVC) in object-oriented programming learning. In the software development industry, most application development uses frameworks. MVC architecture is a design pattern that is widely used by various frameworks. Students as prospective programmers or software developers must master and be able to translate object-oriented programming concepts into programming languages. In this study, the Java programming language is used to apply the object-oriented concept and implement the MVC architecture. This research resulted in an increase in students' programming skills and abilities as well as being able to apply the MVC architecture in developing applications using Java.


I. INTRODUCTION
Bachelor of computer science, especially graduates majoring in Informatics should be able to make computer programs. But in reality, many informatics graduates do not master programming techniques, especially object-oriented programming. On the other hand, the software industry requires graduates who are qualified in their fields. Based on our observations, most graduates majoring in Informatics are not ready to apply their knowledge in the world of work. This is because there is a gap in the learning materials obtained during the study with the needs of the industry. Universities where students study have provided curricula and compulsory subjects related to computer science, including Programming Algorithms and Object-Oriented Programming which are applied to certain programming languages. However, in the learning process sometimes there are obstacles, including the lecturers have not mastered the material and the syllabus provided does not follow the needs of the industry. In addition, lecturers who teach are fixated on the provided teaching materials provided which only come from textbooks. The learning process and the materials presented are not oriented to the needs of the industry. This causes students majoring in Informatics do not have adequate competence.
In the digital era, the industry needs a lot of programmers for application development. Based on data from the national occupational map in the field of information and communication technology (ICT), the need for IT human resources has not been met in almost all categories [1]. Informatics graduates should be able to create computer programs or applications. However, the programming ability of Informatics graduates is generally inadequate. Based on the search results through the google.com search engine with the keywords "Informatics graduates cannot code" (Informatics graduates cannot code) shows that there are many blogs, forums and opinions in various online media, that the programming ability of most Informatics graduates are inadequate. On the other hand, programming languages continue to evolve [2] [3]. Many programming languages are developed using an object-oriented paradigm [4][5] [6]. Therefore, it is a must for a developer to master the concept of object-oriented programming and be able to apply it to programming languages such as Java, .NET, Python, PHP and so on.
This research uses the Java programming language. Java is a programming language that fully supports object-oriented programming concepts [7] [8].
Referring to the Tiobe Programming Community website report, it is stated that Java is a language that has been continuously popular among programmers since late 2014 [9]. The Tiobe site indexes a wide variety of programming languages. The index is calculated from the number of search engine results based on a query containing the name of the programming language which is updated every month. This index includes searches on search engines, Wikipedia and Amazon. Fig. 1 shows the ranking of programming languages. Based on the graph in Fig. 1, it can be seen that Java is a programming language that is ranked at the top. Computer applications are generally built using object-oriented programming languages [10] [11]. Apart from being object-oriented, it also implements the Model View Controller (MVC) architecture. MVC is a design pattern that is widely used by various frameworks [12] and application development [13].
Students of the Informatics Department as prospective programmers must master object-oriented programming concepts, design patterns such as MVC and be able to translate into programming languages. Therefore, we consider it necessary to introduce and apply this MVC architecture to Object Oriented Programming learning. To clarify the research, a research question was made as follows: "How to apply the MVC architectural design pattern in learning Object Oriented Programming using the Java programming language?" The purpose of this study is to provide an overview of how to apply the MVC architectural design pattern to desktop applications and how to implement object-oriented programming concepts in the Java programming language.

II. METHODOLOGY
The research process is divided into three main stages as shown in Fig. 2.

A. Problem Identification and Preliminary Survey
In the first stage, the research team conducted a preliminary survey to identify problems. The research team is a lecturer who specializes in Object Oriented Programming (OOP) courses. At the beginning of the lecture, the researcher conducted a questionnaire to students who took OOP courses. The purpose of the researcher conducting this questionnaire is to obtain the needs and expectations of Informatics students after graduating and after attending OOP courses. The researcher made 8 questions which are presented in Table 1. A total of 47 students filled out the questionnaire as shown in table 1 above. In general, Informatics students want to master the techniques and concepts of object-oriented programming.

B. Object Oriented Programming Concept
The case study in this research uses Object Oriented Programming (OOP) courses. Researchers teach important concepts that must be understood in OOP, namely abstraction, encapsulation, inheritance and polymorphism. The programming language used is Java because it fully supports this concept. The coding technique is done by applying the MVC architecture. The researcher as well as a lecturer in the PBO course begins an explanation of classes, objects and properties using a diagram as shown in Fig. 3.
In figure 3, the property is used to identify the lecturer object. Where a lecturer (object lecturer) will have a NIDN, name and income (income). Meanwhile, to fill and change the value of each property using the set and get methods.

ISSN 2354-0082
Based on the diagram in Fig. 3, it will then be elaborated into the Unified Modeling Language (UML) which is the standard modeling language [14]. The UML notation used is a class diagram. Class diagram is a static model that describes the structure of a system by showing the class names, attributes, operations or methods and the relationships between objects. In general, universities have lecturers in the category of permanent lecturers and part time lecturers. Researchers make class diagrams to explain the concept of inheritance. Fig. 4 shows a class diagram and the concept of inheritance that will be used to form the lecturer object. Next, the researcher translated the class diagram and the concept of inheritance on the lecturer object using the Java programming language. The coding technique uses the MVC architectural design pattern.

C. MVC Implementation
Model View Controller (MVC) is an architecture that is often used in web-based application development [5]. MVC architecture is basically a three-layer architecture (Fig. 5) that has different characteristics in each layer. The first layer is related to user input logic, the second layer is related to business logic and the third layer is used to implement user interface logic.
Many developers use MVC as the standard design pattern. The purpose of this design pattern is to create a program that can be used repeatedly for the same thing (code reuse). In MVC there are three types of classes that are placed in different packages, namely: 1. Model is a class used to implement data domain logic. These classes are used to retrieve, insert or update data into the database associated with the application.
2. View is used to create the application interface. The user interacts with the application using the interface design.
3. A controller is a class that is used to respond to user requests and relate them to the model. MVC architecture really helps developers to control the complexity of application development by dividing it into three parts, namely model, view and controller. The MVC architecture makes it easy to maintain a program. Because all parts of the program have been mapped out in a clear structure. Changes to the design do not change the logic or data. On the other hand, changes to the logic or program can be made in a separate program section [15]. The steps for implementing MVC on desktop applications using the Java programming language and Apache Netbeans IDE version 12.0 are as follows: The first step is to prepare packages to place program codes according to the MVC design pattern as shown in Fig. 6.

ISSN 2354-0082
In the source packages section there is a package mvc.oop.controllers used to accommodate all controllers involved in the application. Package mvc.oop.main contains the main program code that contains the main method, so that the program can be run or executed. The mvc.oop.models package contains classes or program codes related to the model. The mvc.oop.views package contains program code to generate output or design the application user interface. The libraries section is a collection of libraries that are used in the application. In the libraries section there is JDK 14 or Java Development Kit version 14.
After preparing the package, then translating the class diagram in Fig. 4 into Java program code and placing it in the appropriate package.

1) Creating Model
The first class is the Lecturer class which is a super class of the Permanent Lecturer and Part Time Lecturer sub classes. The Lecturer class which is a super class is shown in the Fig. 7 program listings. The Lecturer class declaration on the first line uses the abstract keyword. The abstract keyword means that it does not allow instantiating objects of this class. Object instantiation must be performed on its child class. In this class, the attribute or field declarations that are owned by each lecturer, both permanent lecturers and part time lecturers are declared. This class also contains methods for both changing values and reading values from attributes. After creating the base class, the next step is to create a Permanent Lecturer sub class and a Part Time Lecturer class which is a derivative of the Lecturer class. Fig. 8 is a listing of the Permanent Lecturer class program. In the program code, the extends keyword in the first line indicates that the Lecturer class is a subclass of the Lecturer class. In the next line, a specific attribute is declared to identify the permanent lecturer object, namely EmployeeID. The setIncome() method is a method used to calculate the income of a full-time lecturer. The setIncome() method overloads the setIncome() method in the super class. Method overloading occurs because in the super class the setIncome() method has 2 parameters while the sub class has 3 parameters. Still in the model section, then create a PartTimeLecturer sub class. Listing of the LecturerTransactional class program is shown in Fig.  9. The override method occurs because the setIncome() method in the sub class and in the super class has the same number of parameters. Method overloading and override is a way to implement the concept of polymorphism in object-oriented programming. In the Lecturer class and the PermanentLecturer class there is a private keyword that is used in the attribute declaration. The private keyword is a way to implement the concept of encapsulation in programs.

2) Creating View
To create output that can be seen by the user or users in the Java programming language use the System.out.println() command and to create a graphical display use the JFrame object. The view will be designed based on the properties of the lecturer object that have been defined in the model section. Fig.  10 is a program listing of the LecturerView class. The LecturerView class has two methods with the same name, namely the lecturerInfo() method. This method is an overloading method because it has a different number of parameters. The first lecturerInfo() method is used to display permanent lecturer information and the second lecturerInfo() method is used to display part time lecturer information.

3) Creating Controller
In the MVC architecture, the controller is the link between the model and the view. Fig. 11 is a listing of the Controller class. The LecturerController class above is a liaison between the PermanentLecturer class, PartTime Lecturer in the mvc.oop.models package and the LecturerView in the mvc.oop.views package. In this class, the model and view object declarations are declared. Then define the constructor that will be used to initialize the permanent lecturer object and the part time lecturer object.
In the viewInfoPermanentLect() and viewInfoPartTimeLect() methods, the view object calls the lecturerInfo() method which corresponds to the number of parameters in the LecturerView class. The parameter in the lecturerInfo() method consists of a model object that calls the get method contained in the Lecturer and Permanent Lecturer classes.

4) Creating Main Program
To run the program, you must create a class that contains the main() method. In this class, each lecturer object is instantiated, both permanent lecturers and part time lecturers (Fig. 12). After finishing coding on each part of the MVC architecture, the program can be run. The class that is executed is the Main Menu class. If there is no error (error), it will display the results as shown in Fig. 13. This research produces a computer application that implements:

ISSN 2354-0082
1. The concepts of abstraction, inheritance, encapsulation and polymorphism in objectoriented programming using the Java language.
2. The MVC architectural design pattern is shown in Fig. 14. The entire package will contain program codes that are interconnected. After attending the lecture, the researcher distributed questionnaires to get feedback from the lecture process and tested whether the lecture process met the expectations of the students. The researcher presents the same questions that were done before the lecture process. Table 2 presents the questions and the results of the questionnaire. A total of 45 students filled out the questionnaire and the difference were 2 people from the respondent's data before the lecture.
To make it clearer, we present the data from the questionnaire which has been processed using a spreadsheet application in the form of a bar chart. For example, the researcher presents two questions, namely question 1 and question 8. The results displayed are data before the lecture (meeting 1) and after the lecture is over (meeting 13). The results on the bar chart of Fig. 15 show that informatics students have a desire to master programming techniques. Furthermore, the same question is asked after following the lecture process and the results are shown in Fig 16. Based on student feedback conducted through questions on the questionnaire that after attending lectures and doing assignments with various topics, the average student understands how to implement MVC architecture in the Java programming language (Fig. 17, 18).

IV. CONCLUSION
Based on the results of the questionnaire after the lecture, 78% of students strongly agreed and had a desire to master programming techniques, this result increased by 8% from the questionnaire before the lecture. Furthermore, the ability to implement the MVC architecture increases after going through the lecture process. The results of the questionnaire before the lecture showed as many as 79% of students answered strongly disagree, which means that they have not been able to apply the MVC architecture to software development. However, after attending the lecture, 27% answered agree and 53% answered strongly agree. This shows that there is an increase in students' ability to apply MVC architecture in software development. Learning materials in core competency courses must be taught according to industry needs. Understanding how to implement the MVC architectural design pattern can facilitate the development of neater applications, making it easier to detect errors and build complex applications.