Re: Relational-to-OOP Tax
- From: "topmind" <topmind@xxxxxxxxxxxxxxxx>
- Date: 19 Feb 2007 13:23:05 -0800
Thomas Gagne wrote:
frebe wrote:
But nobody have proved why separating all SQL statements would createYou keep asking for proof without specifying the burden of proof. What
cleaner or more well-factored code.
burden of proof would require for structured programming to prove it is
better to call functions than not to (as used to be the case) or that it
is better to let a filesystem handle file-io than an application to
manipulate disk structures directly (as also used to be the case)? Is
the burden of proof really so different that you can't extrapolate your
experiences calling functions or using open/read/write/close to
manipulate files onto SQL?
It is cleaner when createEmployee(x,y,z) is more realistically imagined:
<snip>
Maintainability and extensibility are two NFRs that come
immediately to mind. Clean code is easier to maintain and extend.
In what what way is
createEmployee(x,y,z)
function createEmployee(x,y,z) {
insert into employee values (x,y,z)
}
cleaner than
insert into employee values (x,y,z)
insert into employee...
insert into address ...
insert into employeeAddress ...
insert into employeeEmployee ...
insert into calendarResource ...
insert into payroll ...
insert into planParticipant ...
insert into benefitParticipant ...
insert into dependents ...
and when another table is created that must know about new employees the
procedure can be updated without modifying application code. Or if
employees can be added from multiple applications it is better to have
isolated the code for adding them than to duplicate it.
In that case I would agree, but because it is an *entire* task in
itself, not just part of a task. But that is not the typical use of
SQL.
Plus, it is a bit of a suspicious design. In most cases there are CRUD
screens to enter each of those *one* at a time. It is not common do
update multiple entities like that all in one shot. First you create
the Employee record and then press Save, then Benefit records and
press Save, etc. One or two entities per CRUD screen is the norm.
Nine is a freak. I suspect you are storing everything in OO
structures first, which is unnecessary.
<snip>Practically speaking that is rarely the case. And even if it occurred
Are you arguing that clean, well-designed code does not have
quality benefits?
No, but creating new functions with only one statement or functions
that are only called only once, doesn't create cleaner or more well-
designed code.
more often than rarely, it is a better design that allows one
module/function/method to change independently of others that rely on it.
I bet I could find counter scenarios for any scenario you present.
Changes come from all directions, not just from pro-OO books.
--
-T-
.
- Follow-Ups:
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: Thomas Gagne
- Re: Relational-to-OOP Tax
- References:
- Re: Critique of Robert C. Martin's "Agile Principles, Patterns, and Practices"
- From: topmind
- Re: Critique of Robert C. Martin's "Agile Principles, Patterns, and Practices"
- From: Patrick May
- Re: Critique of Robert C. Martin's "Agile Principles, Patterns, and Practices"
- From: topmind
- Re: Critique of Robert C. Martin's "Agile Principles, Patterns, and Practices"
- From: Patrick May
- Relational-to-OOP Tax (was: Critique of Robert C. Martin's...)
- From: topmind
- Re: Relational-to-OOP Tax (was: Critique of Robert C. Martin's...)
- From: Patrick May
- Re: Relational-to-OOP Tax (was: Critique of Robert C. Martin's...)
- From: topmind
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: topmind
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: topmind
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: topmind
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: frebe
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: frebe
- Re: Relational-to-OOP Tax
- From: Patrick May
- Re: Relational-to-OOP Tax
- From: frebe
- Re: Relational-to-OOP Tax
- From: Thomas Gagne
- Re: Critique of Robert C. Martin's "Agile Principles, Patterns, and Practices"
- Prev by Date: Re: UML - Modeling Interfaces in "complex" systems
- Next by Date: Re: The reality of Topmind (Was: Topic-Organized Object-Oriented Programming)
- Previous by thread: Re: Relational-to-OOP Tax
- Next by thread: Re: Relational-to-OOP Tax
- Index(es):