对于有使用 xVal 经验的人来说,是否值得学习和使用城堡验证器而不是内置的数据注释?
城堡验证器通过标准数据注释为我提供了什么?
我是 xVal、数据注释和城堡验证器的首次用户,因此无论我决定做什么,都会有一个学习曲线。开始使用 casle 验证器是否值得(我假设它们会更强大)
What does the castle validators offer me over standard data annotations?
I am a first-time user of xVal, data annotations and castle validators so there will be a learning curve regardless of which I decide. Is it worth it to just start using casle validators (I'm assuming they will be more robust)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们选择了 Castle 验证器,因为它们提供的开箱即用的验证属性比数据注释更符合我们想要验证的内容。
延长其中任何一个都很容易,所以我不会因为选择一个而不是另一个而失眠。稍微尝试一下这两者,看看其中一个是否比另一个更适合您的一般需求,然后使用它。
我要给 Castle 的一个提示是,获取我需要的 DLL 比我想象的要痛苦 - 我必须做一些搜索才能获得包含验证器的日常构建。
We went with Castle validators because the validation attributes that they offered out of the box meshed better with what we were trying to validate than data annotations did.
Extending either is pretty easy so I wouldn't lose any sleep about picking one over the other. Play around with the two a little bit and see if one suits your general needs better than the other and then run with it.
The one ding that I will give to Castle is that getting the DLLs that I needed was more of a pain than I would have liked - I had to do a bit of hunting to get to a daily build that includes the validators.