Use Kotlin delegates to split more complex ViewModels

Requirement background In an actual development scenario, the data of a page may be composed of data of multiple businesses. It is implemented using the MVVM architecture, stores and processes data of multiple businesses in the ViewModel, and notifies the View layer to refresh the UI. Legacy implementation For example, in the above example, the […]

C# Lambda expressions and delegates

Directory I. Overview 2. The development history of Lambda Three, the usage of Action Fourth, the usage of Func Finish 1. Overview “Lambda expression” is an anonymous function, which is an efficient expression similar to functional programming. Lambda simplifies the amount of code that needs to be written in development. It can contain expressions and […]

Java-automatically create factories and hot load through events and delegates

Directory 1. Requirements Introduction 2. Implementation process 1. Classes that already exist in the factory method 2. Other business classes other than factory methods 3. Summary and improvement 1. Requirements introduction We have all been exposed to events and delegates when we were learning design patterns, and we have all learned the three brothers of […]