MVC without controller

It has been 25 years since the invention of the Model-View-Controller concept, and disputes and its modifications are not completed to this day. Although it is obvious that in its original form this concept is terrible, not object-oriented and redundant. And it is the presence of the controller that is redundant, while the separation of visualization and business logic is the heart of this concept, which is why this idea lives on until now. But the issue of the controller is blurred, although it is clear that in its place there should be a binding implementation. Especially when the Unity game engine already has this binding initially, although it appeared indirectly. I talk about this in detail in the next video.

0:00 We will not do a full-fledged MVC

1:40 Visualization example (View) and tasks

3:46 Unity specifics

5:00 Creating the PersonUI visualization class and the PersonSlot and PersonSlotExt prefabs

12:15 Binding is implemented through the connection of visual elements in prefabs with the properties of the PersonUI class

15:50 An example of creating an object on the stage through a prefab, filling in the properties of the PersonUI class from the Person class that acts as a model

17:00 The PersonUI render class is aggregated in the Person model class as part

18:00 Create a reaction to the button click event – the OnClick() method

24:00 In the visual class PersonUI, we create a Click event that will occur in the OnClick () method when the user clicks on the button

28:00 In the non-visual Person class, we create the ViewPersonInfo () method, which synchronizes the properties of the visual class with the non-visual

37:15 In the Society class (the highest model in the hierarchy), we aggregate the PersonUI class, which will be used for different Persons

45:10 Subscribe to the Click event in the Society class

46:40 We add a parameter to the event delegate, which will allow you to find out the Id of the person who was clicked (pressed the button)

54:20 Testing, fixing bugs

1:01:40 Earned

1:06:00 Additional refinement, refactoring, etc.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *