L
LeeBase
Ok....my "procedural programmer" roots are probably going to show in
this question.
Say you have a typical data entry forum with the Create, Retrieve,
Update, Delete functions.
Do you create separate action classes and paths for each of these, or
do you create on action which looks for a parameter to determine what
action to take, followed by if/then or switch blocks with calls to
appropriate methods.
After I've typed this, it occurs to me that there is a "Dispatch
Action" class for just this sort of issue.
Still....it begs the question of "best practices" when developing with
OO software. Every time I come to a "if this, then to that, else if
this2 to that2" portion of code, I'm wondering if I'm falling back
into procedural programming.
However, I'm also unsure of the benefit of having 4 separate little
classes for handling the CRUD of a single form.
Lee
this question.
Say you have a typical data entry forum with the Create, Retrieve,
Update, Delete functions.
Do you create separate action classes and paths for each of these, or
do you create on action which looks for a parameter to determine what
action to take, followed by if/then or switch blocks with calls to
appropriate methods.
After I've typed this, it occurs to me that there is a "Dispatch
Action" class for just this sort of issue.
Still....it begs the question of "best practices" when developing with
OO software. Every time I come to a "if this, then to that, else if
this2 to that2" portion of code, I'm wondering if I'm falling back
into procedural programming.
However, I'm also unsure of the benefit of having 4 separate little
classes for handling the CRUD of a single form.
Lee