Thursday, October 18, 2007

stored procedures on oracle -- more words

stored procedures on oracle -- more words

-----------------how (this should be a very simple system, because we do not use them that often -- but when we use them, we really need them immediately, so, the how should be lightweight and can be done everywhere! see "when" below)


For Oracle SP, the key is how to debug or test a sp easily:

1. It is crucial that we develop sp using both sqlplus and other query tools (e.g. toad, even the "simplified" toad). --- More secifically, we need to get used to test-run a sp in "simplified" toad.

2. It is also crucial to "print out" things, using exception and a adhoc table.



-----------------when
1. They should not be used in routine, ordinary, everyday-practice situations.

2. If you really want them (for consistency sake, or, for people who are used to use sp as a managerial control tool), only use simple CRUD. Do not try to use "data logic" to cover up putting "business logic" in sp. "Data logic" is only an optimization issue; so, there is no such a thing as "data logic".

3. SP can and should be used to optimize some logic when necessary.

4. Also, for some aspect of business logic that is already well-isolated (i.e., will not likely to be re-used), and it is pretty low-level, then, we can say they are "data logic" -- but again, there is no such a thing that is wide-spread layer of data-logic!, and we can do it in sp.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home