校验方法的设计
经常会有这种情况 需要做一个校验
并且 不通过的话 需要返回 errorCode、 errorMsg
通过的话 则需要返回相关参数
针对这种场景
1.boolean check(dto); 其中dto既是输入参数 也是输出参数
2.outDto check(inDto);inDto只是输入、outDto只是输出且包含boolean型参数: isPass
3.boolean check(inDto,map);其中map用来存储需同时返回的参数
以上三种哪种更好呢?
qtl {position: absolute;border: 1px solid #cccccc;-moz-border-radius: 5px;opacity: 0.2;line-height: 100%;z-index: 999;direction: ltr;}qtl:hover,qtl.open {opacity: 1;}qtl,qtlbar {height: 22px;}qtlbar {display: block;width: 100%;background-color: #cccccc;cursor: move;}qtlbar img {border: 0;padding: 3px;height: 16px;width: 16px;cursor: pointer;}qtlbar img:hover {background-color: #aaaaff;}qtl>iframe {border: 0;height: 0;width: 0;}qtl.open {height: auto;}qtl.open>iframe {height: 200px;width: 300px;}