Getting Started with C#: How to Reasonably Formulate Method Parameters – Part 1

Getting Started with C#: How to Reasonably Formulate Method Parameters – Part 1 1. Use object-oriented principles to split the functions we face into related objects 2. The same function should only appear in one class. 3. Try to extract the common parts of similar functions The overall goal is simply to reduce the amount of code. Let’s use a dynamic condition query interface to illustrate the above points This is a medical record query function. The list on the left is all the fields that can be selected, the middle is the field that the user requires to query, and the conditions for a certain query field on the right. What classes are used to organize this interface function? The result is not unique, everyone can have their own ideas. But I think organizing it in a way that more people can easily understand should be our goal. The first thing that comes to our mind should be two objects: All fields and Field query range Study the rules of all fields. More often, you should chat face to face with customers. We found that some fields use the same query range entry interface. So there seems to be…

Getting Started with C#: How to Reasonably Formulate Method Parameters – Part 1

Getting Started with C#: How to Reasonably Formulate Method Parameters – Part 1 1. Use object-oriented principles to split the functions we face into related objects 2. The same function should only appear in one class. 3. Try to extract the common parts of similar functions The overall goal is simply to reduce the amount of code. Let’s use a dynamic condition query interface to illustrate the above points This is a medical record query function. The list on the left is all the fields that can be selected, the field in the middle is the field that the user requires to query, and the conditions for a certain query field on the right. What classes are used to organize this interface function? The result is not unique, everyone can have their own ideas. But I think organizing it in a way that more people can easily understand should be our goal. The first thing that comes to our mind should be two objects: All fields and Field query range Study the rules of all fields. More often, you should chat face to face with customers. We found that some fields use the same query range entry interface. So there…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索