1. Disadvantages of using dictionaries
In general, the setting of data and the extraction of data using "String type Key", when writing these keys, the compiler will not have any friendly prompt, need to knock, easy to write wrong key, if the key value is wrong, the compiler will not have any warning and error, resulting in incorrect data or wrong data
2. Benefits of using Models
The so-called model, is actually the data model, specifically used to hold the data object, use it to represent the data will be more professional
The model sets the data and takes out the data through its properties, the property name if the error is written, the compiler will immediately error, so that the correctness of the data
When using a model to access properties, the compiler provides a series of hints to improve coding efficiency
3. Dictionary Turn model
The process of dictionary-to-model is best encapsulated inside the model
The model should provide a construction method that can pass in the dictionary parameters
The benefits of replacing dictionaries with models