校验方法的设计

经常会有这种情况 需要做一个校验
并且 不通过的话 需要返回 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; }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值