The current architecture controller layer and service layer use map<string, string> to transfer values. It feels that value conversion is very troublesome in many cases; but if bean objects are used to transfer values, many beans specifically used to transfer values need to be built. . . . Please give me some advice from the architecture master
某草草2017-05-17 09:59:48
This is a detailed code implementation issue, not the architecture. .
There is obviously a problem with using map to pass parameters. Using encapsulated model to pass values is more semantically clear and easy to maintain. Having too many models is not a problem
If you feel that converting from map to model every time is cumbersome, you can use the BeanUtil tool or write a tool class yourself to do the conversion
黄舟2017-05-17 09:59:48
I agree with the above, many models can be layered using packages
Try to write code that is easy to maintain. Using map as return parameter will be a nightmare for future maintenance
漂亮男人2017-05-17 09:59:48
I agree with the first floor. It is recommended that if there are few parameters, directly pass the variable of the specified type. If there are many parameters, directly create a dto and pass the parameters to the object
仅有的幸福2017-05-17 09:59:48
It is recommended to use beans to pass values, which is safe, reliable and easy to maintain. If the business requires many beans, the beans must be subcontracted and managed hierarchically. A clear and hierarchical project file structure will help clarify development ideas.