 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
jorge novoa Guest
|
Posted: Sat Apr 28, 2007 11:56 pm Post subject: sqlstatment |
|
|
are the sql statments place on sqlstatement class?, even we're talking about classes and objects, at the end the goal its save, retrieve, etc. data from or to databases, so where do i have to store all sql statments matching with the user requests? |
|
| Back to top |
|
 |
Bob Dawson Guest
|
Posted: Sun Apr 29, 2007 12:33 am Post subject: Re: sqlstatment |
|
|
"jorge novoa" <pippen_8 (AT) todito (DOT) com> wrote in message
news:463398d2$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
so where do i have to store all sql statments matching with the user
requests?
|
There are at least four main options
1. Use a datamodule in support of each BO class. Store each class's
statements there where only the BO (or its persistence helper class) can get
it.
2. Store all SQL statements in local files, and load them from there. This
allows updating the sql without recompling; you just have to distribute an
updated SQL resources file..
3. Use a system for autogenerating SQL based on reading the BO or associated
metadata. This requires either a supporting design for the BOs, or a
developed metadata system that can guide runtime SQL creation. A bit more
complicated than either 1 or 2, but really reduces the total amount of time
spent on building and maintaining rote SQL statements.
4. Treat SQL statements as themselves a persistent BO domain: store SQL
statements in the database. Again, a bit more complicated, but this allows
for non-predictable SQL, mixing SQL statements and Stored Procs, and other
optimizations.
bobD |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|