Click here to Skip to main content
15,796,984 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: In OO, How to handle the object parameter of a method Pin
Gerry Schmitz2-Apr-21 7:17
mveGerry Schmitz2-Apr-21 7:17 
AnswerRe: In OO, How to handle the object parameter of a method Pin
Dave Kreskowiak2-Apr-21 7:49
mveDave Kreskowiak2-Apr-21 7:49 
GeneralRe: In OO, How to handle the object parameter of a method Pin
Eddy Vluggen2-Apr-21 12:53
professionalEddy Vluggen2-Apr-21 12:53 
AnswerRe: In OO, How to handle the object parameter of a method Pin
codecs12-Apr-21 18:50
codecs12-Apr-21 18:50 
GeneralRe: In OO, How to handle the object parameter of a method Pin
Richard MacCutchan2-Apr-21 22:31
mveRichard MacCutchan2-Apr-21 22:31 
GeneralRe: In OO, How to handle the object parameter of a method Pin
codecs13-Apr-21 17:58
codecs13-Apr-21 17:58 
GeneralRe: In OO, How to handle the object parameter of a method Pin
jschell9-Apr-21 16:10
jschell9-Apr-21 16:10 
GeneralRe: In OO, How to handle the object parameter of a method Pin
Rob Grainger6-Jul-21 12:09
Rob Grainger6-Jul-21 12:09 
AnswerRe: In OO, How to handle the object parameter of a method Pin
Bohdan Stupak6-Apr-21 23:20
professionalBohdan Stupak6-Apr-21 23:20 
GeneralRe: In OO, How to handle the object parameter of a method Pin
Rob Grainger6-Jul-21 12:11
Rob Grainger6-Jul-21 12:11 
GeneralRe: In OO, How to handle the object parameter of a method Pin
Bohdan Stupak25-Jul-21 0:40
professionalBohdan Stupak25-Jul-21 0:40 
QuestionHow can a method return a validation result Pin
codecs112-Mar-21 20:54
codecs112-Mar-21 20:54 
Assume there is a method which return the query result List<Student>
List<Student> FindStudents(StudentCriteria sc);
in which the StudentCriteria is a model for passing the search information:
public class StudentCriteria
{
    public string Name { set; get; }
    public int? Age { set; get; }
    public DateTime? BeginRegisterDate { set; get; }
    public DateTime? EndRegisterDate { set; get; }
}
Moveover, we should validate the input parameter StudentCriteria , so we call the following method in FindStudents(...)
ValidationResult Validate(StudentCriteria sc);
in which ValidationResult is an object representing the validation result, something like that:
public class ValidationResult
{
    public bool Success { set; get; }
    public List<String> ErrorInfo { set; get; }
}
All 'Error' information will be contained in ValidationResult and return to FindStudents(...) if Validate(...) finds any problem in StudentCriteria sc:
such as Age is negative int, EndRegisterDate is before BegionRegisterDate...

But, how can FindStudents(...) return the ValidationResult to the caller?

-----Someone may consider that FindStudents(...) throws ArgumentException to the caller if StudentCriteria sc is invalid....

However, I think Exceptions are for exceptional circumstances
AnswerRe: How can a method return a validation result Pin
Gerry Schmitz13-Mar-21 8:56
mveGerry Schmitz13-Mar-21 8:56 
AnswerRe: How can a method return a validation result Pin
Mycroft Holmes13-Mar-21 12:13
professionalMycroft Holmes13-Mar-21 12:13 
AnswerRe: How can a method return a validation result Pin
Eddy Vluggen13-Mar-21 13:11
professionalEddy Vluggen13-Mar-21 13:11 
AnswerRe: How can a method return a validation result Pin
codecs113-Mar-21 20:02
codecs113-Mar-21 20:02 
AnswerRe: How can a method return a validation result Pin
Richard Deeming14-Mar-21 23:21
mveRichard Deeming14-Mar-21 23:21 
GeneralRe: How can a method return a validation result Pin
codecs116-Mar-21 1:15
codecs116-Mar-21 1:15 
Questionwhat is types of Architecturel rendering ? Pin
Member 1506545022-Feb-21 0:46
Member 1506545022-Feb-21 0:46 
AnswerRe: what is types of Architecturel rendering ? Pin
Victor Nijegorodov22-Feb-21 2:19
Victor Nijegorodov22-Feb-21 2:19 
QuestionHow to store data to be able to report on it. Pin
20212a11-Feb-21 8:05
20212a11-Feb-21 8:05 
AnswerRe: How to store data to be able to report on it. Pin
Gerry Schmitz11-Feb-21 8:15
mveGerry Schmitz11-Feb-21 8:15 
GeneralRe: How to store data to be able to report on it. Pin
20212a11-Feb-21 8:33
20212a11-Feb-21 8:33 
GeneralRe: How to store data to be able to report on it. Pin
Gerry Schmitz11-Feb-21 8:45
mveGerry Schmitz11-Feb-21 8:45 
GeneralRe: How to store data to be able to report on it. Pin
Mycroft Holmes11-Feb-21 11:07
professionalMycroft Holmes11-Feb-21 11:07 

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.