.NET中数据注释和流畅验证的比较研究

Q3 Computer Science International Journal of Computing Pub Date : 2024-04-01 DOI:10.47839/ijc.23.1.3437
V. Samotyy, U. Dzelendzyak, N. Mashtaler
{"title":".NET中数据注释和流畅验证的比较研究","authors":"V. Samotyy, U. Dzelendzyak, N. Mashtaler","doi":"10.47839/ijc.23.1.3437","DOIUrl":null,"url":null,"abstract":"This article presents a comparative study of two validation approaches in .NET – Data Annotations and Fluent Validation – analyzing their syntax, functionality, and other factors (such as readability, maintainability, and performance). The study begins by examining the Data Annotations approach, an in-built validation mechanism in the .NET Framework that uses validation attributes to validate model properties. While Data Annotations offers a simple syntax and is well-known to .NET developers, it may not be ideal for more complex validation scenarios and could become verbose and difficult to maintain. The study then introduces the Fluent Validation approach, which utilizes a fluent syntax to define validation rules in a more expressive, readable, and concise manner. With its flexible architecture and fluent API (application programming interface), Fluent Validation provides greater control over the validation process, enabling better maintainability and performance. The study concludes by highlighting the merits and drawbacks of both approaches, noting that the choice of validation approach will depend on the specific requirements of the project at hand.","PeriodicalId":37669,"journal":{"name":"International Journal of Computing","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"A Comparative Study of Data Annotations and Fluent Validation in .NET\",\"authors\":\"V. Samotyy, U. Dzelendzyak, N. Mashtaler\",\"doi\":\"10.47839/ijc.23.1.3437\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"This article presents a comparative study of two validation approaches in .NET – Data Annotations and Fluent Validation – analyzing their syntax, functionality, and other factors (such as readability, maintainability, and performance). The study begins by examining the Data Annotations approach, an in-built validation mechanism in the .NET Framework that uses validation attributes to validate model properties. While Data Annotations offers a simple syntax and is well-known to .NET developers, it may not be ideal for more complex validation scenarios and could become verbose and difficult to maintain. The study then introduces the Fluent Validation approach, which utilizes a fluent syntax to define validation rules in a more expressive, readable, and concise manner. With its flexible architecture and fluent API (application programming interface), Fluent Validation provides greater control over the validation process, enabling better maintainability and performance. The study concludes by highlighting the merits and drawbacks of both approaches, noting that the choice of validation approach will depend on the specific requirements of the project at hand.\",\"PeriodicalId\":37669,\"journal\":{\"name\":\"International Journal of Computing\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-04-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"International Journal of Computing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.47839/ijc.23.1.3437\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"Computer Science\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Journal of Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.47839/ijc.23.1.3437","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 0

摘要

本文对 .NET 中的两种验证方法--数据注解和流畅验证--进行了比较研究,分析了它们的语法、功能和其他因素(如可读性、可维护性和性能)。研究首先考察了数据注解方法,这是 .NET 框架中的一种内置验证机制,它使用验证属性来验证模型属性。虽然数据注解提供了简单的语法,并为 .NET 开发人员所熟知,但它可能并不适合更复杂的验证场景,而且会变得冗长和难以维护。本研究随后介绍了流畅验证方法,该方法利用流畅的语法,以更具表现力、可读性和简洁的方式定义验证规则。凭借其灵活的架构和流畅的 API(应用程序接口),流畅验证可以更好地控制验证过程,从而提高可维护性和性能。本研究最后强调了这两种方法的优缺点,并指出验证方法的选择取决于当前项目的具体要求。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
A Comparative Study of Data Annotations and Fluent Validation in .NET
This article presents a comparative study of two validation approaches in .NET – Data Annotations and Fluent Validation – analyzing their syntax, functionality, and other factors (such as readability, maintainability, and performance). The study begins by examining the Data Annotations approach, an in-built validation mechanism in the .NET Framework that uses validation attributes to validate model properties. While Data Annotations offers a simple syntax and is well-known to .NET developers, it may not be ideal for more complex validation scenarios and could become verbose and difficult to maintain. The study then introduces the Fluent Validation approach, which utilizes a fluent syntax to define validation rules in a more expressive, readable, and concise manner. With its flexible architecture and fluent API (application programming interface), Fluent Validation provides greater control over the validation process, enabling better maintainability and performance. The study concludes by highlighting the merits and drawbacks of both approaches, noting that the choice of validation approach will depend on the specific requirements of the project at hand.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
International Journal of Computing
International Journal of Computing Computer Science-Computer Science (miscellaneous)
CiteScore
2.20
自引率
0.00%
发文量
39
期刊介绍: The International Journal of Computing Journal was established in 2002 on the base of Branch Research Laboratory for Automated Systems and Networks, since 2005 it’s renamed as Research Institute of Intelligent Computer Systems. A goal of the Journal is to publish papers with the novel results in Computing Science and Computer Engineering and Information Technologies and Software Engineering and Information Systems within the Journal topics. The official language of the Journal is English; also papers abstracts in both Ukrainian and Russian languages are published there. The issues of the Journal are published quarterly. The Editorial Board consists of about 30 recognized worldwide scientists.
期刊最新文献
Website Quality Measurement of Educational Government Agency in Indonesia using Modified WebQual 4.0 A Comparative Study of Data Annotations and Fluent Validation in .NET Attr4Vis: Revisiting Importance of Attribute Classification in Vision-Language Models for Video Recognition The Improved Method for Identifying Parameters of Interval Nonlinear Models of Static Systems Image Transmission in WMSN Based on Residue Number System
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1