Tags for questions related to validating data.

learn more… | top users | synonyms

0
votes
3answers
89 views

Coerce bad input or always crash early

The general consensus seems to favor the Crash Early approach, the most reputable source being the acclaimed Pragmatic Programmer book. And while I understand and agree with the advice in many ...
1
vote
2answers
199 views

Why all consider UAT a validation activity? It contradicts the original idea

Virtually any book dealing with software testing mentions that user acceptance testing (UAT) is an ultimate validation activity, often quoting Boehms informal definition: "Validation: Are building the ...
0
votes
0answers
33 views

How to use ASP.Net data annotations in AngularJS ng-repeat? [migrated]

I am in the process of migrating our app to AngularJS, and so far everything is going great. The one thing I'm having trouble with is validation of models using ASP.Net built in data annotations. ...
1
vote
0answers
106 views

Which user input validation approach is better: preventing or explaining? [migrated]

Scenario: let's say we are talking about a simple form, which contains the following field types: All fields are mandatory. Number: only digits are allowed. Text: text must not exceed the maximum ...
1
vote
4answers
95 views

Domain Model, validation, and pushing errors to the model

Looking into DDD and something I noticed is that business logic should be in the model, otherwise you just have property bags. That said how do you handle pieces of validation that require a trip to ...
4
votes
8answers
324 views

Do objects with validation logic in their domain really represent their real world counterparts?

I asked a question about whether validation behavior should be treated the same as other types of behavior in regard to the concept of OOP being "data + behavior". I got some good answers back that ...
2
votes
3answers
258 views

OOP: Behavior + Data, but what about 'validation' behaviors?

EDIT: Thanks for all the great answers! In reading these responses I realized that I'm approaching this from the wrong angle so I wrote a new question here. I had this discussion with my superior ...
3
votes
1answer
109 views

Difference between patterns: Specification, Guarding, Conditions, Monads, Validation,

I'm currently trying to get my head around a few patterns (especially the ones mentioned in the title above) that are made to address different problems and are being used in different parts of the ...
-1
votes
1answer
59 views

Is there a set of standards for data validation rules? [closed]

I'm trying to develop a generic data validation engine for web forms. Basically, the idea is to write a library that loads a JSON "validation schema", and then generates the appropriate server-side ...
2
votes
2answers
132 views

Should I throw guard exceptions that will be thrown by internal methods anyway?

I have some fairly simple code (C#): /// <summary> /// Truncates a string to a maximum length. /// </summary> /// <param name="value"> The string to truncate. ...
0
votes
0answers
17 views

A scheme to check only one namespace in an XML document

I want to validate an XML document against some XML scheme, but ignore all elements (and probably attributes) which are not of a given namespace. Does such a XML scheme language exist?
1
vote
2answers
128 views

Where should the “not empty field” validation code be written on a 3-layer application?

When working with the 3-layer model, where should the validation code be placed? for: not empty fields, unchecked options, null values, wrong-written dates, etc. To keep total isolation between a ...
1
vote
2answers
97 views

Writing a simple code validator

I know that programming languages can be defined in EBNF which can be converted into regular expressions. Right now I am working on a very simple BASIC interpreter for a project. The code has to be ...
2
votes
2answers
241 views

Where to put format validation in a CQRS “stylish” domain model?

It feels right to put format validation inside the domain objects (VOs or entities) because it is the natural place for high cohesion and the domain knows best what every domain ...
1
vote
2answers
43 views

Property value validations on POCO entities

Sorry in advance if this question is so trivial. The situation There is a Customer entity whose ID is limited to two letters (A to Z) in the database. Also, a user can enter the ID value from a ...
1
vote
1answer
216 views

Presenter accessing the value in text box using sender object

I have following method in my presenters which validates the user inputs on the UI. Basically to capture the value of the text property of the text box, it uses sender object which was passed in by ...
0
votes
0answers
120 views

UI Field validation in MVP pattern

I want to validate the details provided by the user before taking them into the processing. My UIs have Text boxes, Combos mainly and, there are some fields that user must provide a data, in some ...
0
votes
0answers
73 views

What should a domain object's validation cover?

I'm trying to figure out how to do validation of domain objects that need external resources, such as data mappers/dao Firstly here's my code class User { const INVALID_ID = 1; const ...
3
votes
4answers
103 views

Can I save & store a user's submission in a way that proves that the data has not been altered, and that the timestamp is accurate?

There are many situations where the validity of the timestamp attached to a certain post (submission of information) might be invaluable for the post owner's legal usage. I'm not looking for a service ...
5
votes
4answers
454 views

Managing client-side and server-side validations in one place

I'm 100% on board with the case that one should definitely use both client-side and server-side data validations. However, in the frameworks and environments I've worked in, the approaches I've seen ...
0
votes
0answers
107 views

WPF Control Lifeycle and Navigating through Containers to set Focus

I wanted to understand a control's lifecycle in WPF. Let me explain my scenario: I have a complex screen containing various container controls hosting forms. Let's say my screen has 3 Accordion ...
2
votes
2answers
145 views

Allowing enum to express a valid combination of values

Suppose in a manufacturing environment, there are certain stock materials available for use in a product. For example, there are only a few different sizes of copper tube, each having a specific ...
0
votes
0answers
93 views

Model Driven Design with Bean Validation

If I have a rich domain library that gets included into a Java web application, but I want to achieve a level of dependency isolation with that domain library such that it is possible to build and ...
1
vote
2answers
120 views

Is input validation necessary?

This is a very naive question about input validation in general. I'm a MATLAB user (1.5 years old) and I learned about input validation techniques such as "parse" and "validatestring". In fact, ...
0
votes
1answer
148 views

DataSet Validation vs. ASP.NET MVC Validation

I have a general question on where to put validation. I have an asp.net mvc that gets/sets data from/to a DataSet. Currently, the fields in the form are validated by the form itself (e.g. for ...
3
votes
4answers
2k views

Best way of validating Class properties

Background: I have a CSV file, which I need to ready and validate each element in each row and create a collection of a class, having valid data. i.e CSV File looks like: ...
0
votes
1answer
60 views

How to prevent re-checking already-checked data?

I have a class with a validId($id) method that is called by the constructor and by public function load($id). The method queries the database to see if the id exists and returns true/false. The ...
1
vote
2answers
452 views

How can I write complex validation and business logic that can be reused in both direct data model changes and pending dialog changes?

I was hoping for some advice: I need to design a software solution for a medium-sized java / Swing application. The application will have about 200 use cases requiring complex data validation and ...
1
vote
2answers
175 views

Setter Validation can affect performance?

In a scenario where you use an ORM to map your entities to the DB and you have setter validations (nullable, date lower than today validation, etc), every time the ORM gets a result, it will pass into ...
3
votes
2answers
874 views

Validation and data persistence in a domain model

My (first and current) workplace (a .NET shop) suffers from an over-abundance of anemic domain models, to the extent that I don't really know how validation and data persistence should be handled in a ...
1
vote
1answer
666 views

Where to validate domain model rules that depend on database content?

I'm working on a system that allows Administrators to define Forms that contain Fields. The defined Forms are then used to enter data to the system. Sometimes the Forms are filled by a human via a ...
0
votes
4answers
141 views

Should user input of a contact form be validated?

On software company websites I visit the first time, I often open the "Contact us" page and try to submit the contact form with all fields empty. I am just curios if they validate the user input. If ...
7
votes
1answer
1k views

Duck typing, data validation and assertive programming in Python

About duck typing: Duck typing is aided by habitually not testing for the type of arguments in method and function bodies, relying on documentation, clear code and testing to ensure correct use. ...
6
votes
6answers
1k views

If the model is validating the data, shouldn't it throw exceptions on bad input?

Reading this SO question it seems that throwing exceptions for validating user input is frowned upon. But who should validate this data? In my applications, all validations are done in the business ...
12
votes
5answers
872 views

Strengthening code with possibly useless exception handling

Is it a good practice to implement useless exception handling, just in case another part of the code is not coded correctly? Basic example A simple one, so I don't loose everybody :). Let's say I'm ...
5
votes
8answers
1k views

Best Practice for Argument Checking

Say I have a web service with a method MyWebServiceMethod(string passedValue). The web service calls a method MyServiceMethod(string passedValue) where the value from the web service is passed along. ...
3
votes
3answers
195 views

Complex Mutual Exclusion Validation Logic

I need to validate some form inputs in complex way. E.g. <select id="options" multiple="multiple"> <option>A</option> <option>B</option> ...
2
votes
3answers
293 views

Approach to use for user email address change in application?

As the title says, if the user wants change their email address in the application, in terms of programming, what approach (process) to use? Where do you store the new email address until the user ...
2
votes
5answers
899 views

Why validate XML?

I am looking for an explanation on just why XML needs to be validated. I have been testing DTD's and Schema's for the past month and recently tried to find out why I am doing this. I know it makes the ...
0
votes
3answers
573 views

Form validation and file structure

I have a form (lets say a registration form) and onsubmit, it calls a function to validate as follows: $.ajax({ url : "/ajax/validate.php", type : "POST", data : ...
0
votes
2answers
731 views

What is the best practice for method parameter validation in a library? [closed]

I develop a game library in javascript, containing many classes. I hesitate on the behavior that I should follow concerning method parameter validation: Should I check the validity of parameters ...
4
votes
2answers
291 views

Design strategies for storing and validating serial numbers

We are writing software to track Foo Widgets. Each Foo Widget has a serial number. The serial number is an 32-character alphanumeric string. The string is separated into five sets. Each set is ...
2
votes
2answers
282 views

How do you track third party services SSL certificates?

Recently Windows Azure Storage SSL certificate unexpectedly expired and since a lot of dependent services defaulted to "refuse to connect to a site with expired SSL certificate" that became a serious ...
2
votes
6answers
2k views

Validation of the input parameter in caller: code duplication?

Where is the best place to validate input parameters of function: in caller or in function itself? As I would like to improve my coding style, I try to find the best practices or some rules for this ...
1
vote
1answer
359 views

What is a practical level of abstraction in a web application? [closed]

(Originally asked on StackOverflow - http://stackoverflow.com/questions/14896121/what-is-a-practical-level-of-abstraction-in-a-web-application) I still consider myself a newcomer to OO programming, ...
5
votes
2answers
868 views

How is the Trial Period for Softwares generally implemented?

I was always under the assumption that trial softwares write a registry value of the installation date and then the software makes a comparison of the current date of the system with the remaining ...
8
votes
7answers
4k views

When should pointers be checked for NULL in C?

Summary: Should a function in C always check to make sure it is not dereferencing a NULL pointer? If not when is it appropriate to skip these checks? Details: I've been reading some books about ...
4
votes
1answer
790 views

MVC Pattern - How to get errors from the model to the controller?

Say I have a typical MVC setup. The controller passes on some input to the model, and asks it to do something with it. But the validation of the data fails, or there is some other problem. What's the ...
2
votes
2answers
891 views

Validating Objects With XSDs: Is Re-Serializing Redundant or Negligible?

Context: I've got a web service that deals with request / response objects. There are strict, externally-defined schemas constraining both the structure and the content of both requests and ...
8
votes
1answer
384 views

Better to use error monad with validation in your monadic functions, or implement your own monad with validation directly in your bind?

I'm wondering what's better design wise for usability/maintainability, and what's better as far as fitting with the community. Given the data model: type Name = String data Amount = Out | Some | ...