CodeGym /Courses /Java Collections /Tasks | Level 6 | Lesson 4

Tasks | Level 6 | Lesson 4

Java Collections
Level 6 , Lesson 4
Available

"Hi, Amigo."

"Hi, Diego. What's with the Chinese characters with a button in the center?"

Tasks | Level 6 | Lesson 4 - 1

"It's the famous MVC design pattern! You have to know it. So, go wrap your head around the MVC pattern real quick. I think you'll understand what the characters mean after you finish the task. I'll give you one easy task and another large and more difficult task. When you solve the easy one, move on to the large one."

16
Task
Java Collections, level 6, lesson 4
Locked
MVC - a simplified version
Create the Service, Model, View, and Controller classes in separate files. Move the Solution class's methods to the created classes in accordance with how MVC should work. Create the required fields in the classes as needed. Don't add any other methods of your own.
16
Task
Java Collections, level 6, lesson 4
Locked
Refactoring MVC
Move a few methods into the required classes to get the MVC pattern. If necessary, make changes in the main method that reflect the changes you've made. The program's behavior must not change. Do NOT change class, method, or field names.
Comments (3)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Vahan Level 41, Tbilisi, Georgia
13 June 2020
We were taught that refactoring should optimize the code, but in the second task we are urged to do the opposite, if we follow the instructions of the task exactly.
Andrei Level 41
21 July 2021
I know right? Basically it asks to move the computing of the speed from the Model (where it belongs) to the controller.
Thomas Level 41, Bayreuth, Germany
4 April 2023
Increasing and decreasing speed probably should represent user input. And that's a job for the controller.