关于整洁的代码,在 java 中使用前缀“get”作为函数名称是不是不好的做法,因为它可能与 java beans 混淆?
示例:carService.getCarDetails()、customerService.getCustomers() ...
最佳答案
如果它执行更多操作,您可能想说“calclulateBalance()”或“findCustomerForID(String userID)”,但发现使用“get”。
关于java - 整洁的代码: Using prefix get for java function name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58683404/