Click here to Skip to main content
15,891,828 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: asp.net + oracle project architecture Pin
praetorean8-Oct-07 23:25
praetorean8-Oct-07 23:25 
GeneralRe: asp.net + oracle project architecture Pin
il_masacratore9-Oct-07 2:54
il_masacratore9-Oct-07 2:54 
GeneralRe: asp.net + oracle project architecture Pin
praetorean30-Oct-07 1:07
praetorean30-Oct-07 1:07 
GeneralRe: asp.net + oracle project architecture Pin
il_masacratore30-Oct-07 1:26
il_masacratore30-Oct-07 1:26 
GeneralRe: asp.net + oracle project architecture Pin
praetorean30-Oct-07 16:45
praetorean30-Oct-07 16:45 
GeneralRe: asp.net + oracle project architecture Pin
il_masacratore30-Oct-07 22:33
il_masacratore30-Oct-07 22:33 
QuestionSimple Object Validation? Pin
Wauna5-Oct-07 9:26
Wauna5-Oct-07 9:26 
AnswerRe: Simple Object Validation? Pin
WillemM7-Oct-07 7:42
WillemM7-Oct-07 7:42 
There are several methods for this. I created one using Extension methods in C#.
The basic idea would be to create a class that implements a static method to implement a generic object. This method should accept the object to validate and a set of rules to validate the object against. If the validation fails the method should throw an exception containing the reason why the validation failed (Preferrably a message configured on a rule that failed validation).

Implementation could look like this:

public static class ObjectValidator {
  public static void Validate(object objectToValidate,ValidationRuleSet ruleSet) {
    foreach(ValidationRule rule in ruleSet) {
      if(!rule.Validate(objectToValidate)) {
        throw new ValidationException(rule.ErrorMessage);
      }
    }
  }
}


Of course you need to expand this to support validation of specific properties each with multiple rules to check required fields and validate the value of the field against some pattern for example.

There should be some standard components out there that can be quite a timesaver here. Last time I checked Microsoft had a validation application block in their enterprise library which should fit quite nicely.

WM.

What about weapons of mass-construction?

"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog

AnswerRe: Simple Object Validation? Pin
DavidNohejl8-Oct-07 22:05
DavidNohejl8-Oct-07 22:05 
GeneralRe: Simple Object Validation? Pin
Wauna9-Oct-07 3:21
Wauna9-Oct-07 3:21 
QuestionUML concept Pin
KASR14-Oct-07 21:28
KASR14-Oct-07 21:28 
AnswerRe: UML concept Pin
Maximilien5-Oct-07 2:57
Maximilien5-Oct-07 2:57 
AnswerRe: UML concept - FREE UML Tools released for Visual Studio Pin
fischetm6-Oct-07 6:36
fischetm6-Oct-07 6:36 
AnswerRe: UML concept Pin
garyshort20-Oct-07 8:07
garyshort20-Oct-07 8:07 
QuestionBANK ACCOUNT NUMBERS Pin
Radegonda4-Oct-07 4:54
Radegonda4-Oct-07 4:54 
AnswerRe: BANK ACCOUNT NUMBERS Pin
Luc Pattyn4-Oct-07 8:34
sitebuilderLuc Pattyn4-Oct-07 8:34 
GeneralRe: BANK ACCOUNT NUMBERS Pin
Radegonda5-Oct-07 11:13
Radegonda5-Oct-07 11:13 
GeneralRe: BANK ACCOUNT NUMBERS Pin
Luc Pattyn5-Oct-07 11:35
sitebuilderLuc Pattyn5-Oct-07 11:35 
QuestionHandling text data retrieved from file Pin
rsaint272-Oct-07 3:30
rsaint272-Oct-07 3:30 
GeneralRe: Handling text data retrieved from file Pin
Paul Conrad27-Jan-08 7:13
professionalPaul Conrad27-Jan-08 7:13 
QuestionA basic object diagram? Pin
Wauna1-Oct-07 6:26
Wauna1-Oct-07 6:26 
AnswerRe: A basic object diagram? Pin
stavinski2-Oct-07 22:37
stavinski2-Oct-07 22:37 
GeneralRe: A basic object diagram? Pin
Wauna3-Oct-07 8:40
Wauna3-Oct-07 8:40 
GeneralRe: A basic object diagram? Pin
stavinski4-Oct-07 2:58
stavinski4-Oct-07 2:58 
GeneralRe: A basic object diagram? Pin
Wauna4-Oct-07 3:36
Wauna4-Oct-07 3:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.