MVC (part 8)

  • 26
  • Locked
1. Following the MVC pattern, do the following by analogy with how the previous methods were implemented: write the logic for deleting a user. After a deletion operation, the list of users must be displayed. Assign the following methods to MVC classes.
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 40 , Greenfield, USA, United States
16 January 2022, 23:39
Very challenging task, made more difficult by some confusing directions. To save you from experiencing my misery, I'm going to say, when it says "the method that you previously implemented in the MainModel class" it does not actually mean the last method you implemented in the MainModel class (which would be the private getAllUsers() method). It means one of the three in Step 1-3. I spent half the day trying to find some workaround to get a private method declared in an interface. CG should fix that step to be more clear. In the end, I got it. Very satisfying to complete!
Jurij Thmsn
Level 29 , Flensburg, Germany
28 October 2021, 15:01
The validator told me the order of method calls was wrong in the Solution's main method, even though it was as reequested. I changed some new-Line charachters in the output methods and passed. this is the exact output with which I passed - maybe it helps you.
All users:
	User{name='Franklin', id=123, level=1}
	User{name='Sanchez', id=125, level=1}
	User{name='Sanchez', id=124, level=2}
	User{name='Smith', id=126, level=2}
===================================================
User to be edited:
	User{name='Smith', id=126, level=2}
===================================================
All users:
	User{name='Franklin', id=123, level=1}
	User{name='Sanchez', id=125, level=1}
	User{name='Smith', id=126, level=2}
===================================================
All deleted users:
	User{name='Sanchez (deleted)', id=124, level=2}
===================================================