in reply to constructing dynamic class definitions at compile time (from schema definition)
You're creating classes to represent tables, in a 1-1 relationship. I'm trying to figure out why.
Wouldn't it be better to create classes that represent logical concepts in your business logic? Then, go ahead and create tables that represent the fully normalized way to store any data needed for those classes to work. Within the class, you map between the logical and structural.
My gripe is because this seems to be a knee-jerk reaction, especially in systems where the applications developer is also the DBA (or, at least, plays one on TV). This results in extremely unmaintainable code. For example, what if your schema changes? Your entire application code now has to change. (This is called "tight coupling".)
Better is to do what I suggested, and let your schema and application change independent of each other. The only coupling you have is in the guts of your classes. (This is called "loose coupling".)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: constructing dynamic class definitions at compile time (from schema definition)
by sozinsky (Initiate) on Jul 25, 2002 at 16:21 UTC | |
by dragonchild (Archbishop) on Jul 25, 2002 at 18:48 UTC |