dbTalk Databases Forums  

Do you use PL/SQL

comp.databases.oracle.server comp.databases.oracle.server


Discuss Do you use PL/SQL in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #131  
Old   
Jonathan Lewis
 
Posts: n/a

Default Re: Myth of the database independent applications (Was: Are you using PL/SQL) - 05-27-2007 , 11:38 AM






<zigzagdna (AT) yahoo (DOT) com> wrote

Quote:
Three tier architecture is "standard" as well as good architecture
because it separates UI, Buisness Logic and database. UI only does UI,
database only stores data and busines slogic does the rest.

I've always been fascinated by the concept of business logic
being totally divorced from data correctness.

Either the data is a correct description of the state of
the business, or it is not - which means the "business
logic" is inherent in the data and enforced by the
constraints on the data.

You may choose to have as many layers of code as
you like to transform the data from one valid state to
another valid state; but if you rely on programs to
maintain data correctness, you don't have a database,
you have a bit-bucket.

Three-tier is not an ideal to be aimed for, it is crutch to
be used as sparingly as possible until the database technology
is good enough to walk unaided.


--
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html





Reply With Quote
  #132  
Old   
zigzagdna@yahoo.com
 
Posts: n/a

Default Re: Myth of the database independent applications (Was: Are you using PL/SQL) - 05-27-2007 , 02:56 PM






On May 27, 12:38 pm, "Jonathan Lewis" <jonat... (AT) jlcomp (DOT) demon.co.uk>
wrote:
Quote:
zigzag... (AT) yahoo (DOT) com> wrote in message

news:1180257868.590456.84400 (AT) q69g2000hsb (DOT) googlegroups.com...



Three tier architecture is "standard" as well as good architecture
because it separates UI, Buisness Logic and database. UI only does UI,
database only stores data and busines slogic does the rest.

I've always been fascinated by the concept of business logic
being totally divorced from data correctness.

Either the data is a correct description of the state of
the business, or it is not - which means the "business
logic" is inherent in the data and enforced by the
constraints on the data.

You may choose to have as many layers of code as
you like to transform the data from one valid state to
another valid state; but if you rely on programs to
maintain data correctness, you don't have a database,
you have a bit-bucket.

Three-tier is not an ideal to be aimed for, it is crutch to
be used as sparingly as possible until the database technology
is good enough to walk unaided.

--
Regards

Jonathan Lewishttp://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentalshttp://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQhttp://www.jlcomp.demon.co.uk/faq/ind_faq.html
You may choose to have as many layers of code as
you like to transform the data from one valid state to
another valid state; but if you rely on programs to
maintain data correctness, you don't have a database,
you have a bit-bucket.
Not sure what do you mean by :"if you rely on programs to ....". PL/
SQL is a programming language so are C++ and Java. So you are writing
programs either way. Many releases ago, database only had ability to
store data. Then triggers , referetial intergity were introduced. In
conjunction with it database provided some programming langauge like
PL/SQL. Then vendors like Oracle started putting everything in
database (never made any sense). For example, there have been many
discussions whether to do all XML processing in database or not.
Fortunately, there are choices avaialble. If you are an Oracle sales
person, you may do whatever you can in PL/SQL. But there are other
options such as C++ and Java which make lot more sense to me and many
developers. Oracle has always recognized it that's why Oracle always
provided PRO*C, JDBC etc.. Also, you should be aware that Oracle is
not the only database. There are many sofwatre vendors such as SAP and
EMC Documentum (billions of dollars companies) do not use PL/SQL at
all. You do not have to be a rocket scuenst to figure out why.SAP,and
Documentum work with many databases not just Oracle.

Yes, you are right one does not have to limit to three tires. In
fact, as I said business logic is split into may processes/threads. If
one uses object-rieneted lanaguages such as C++ and Java, one can
develop layers of classes. Use inheritance etc. That is what software
engineering is all about.



Reply With Quote
  #133  
Old   
Jonathan Lewis
 
Posts: n/a

Default Re: Myth of the database independent applications (Was: Are you using PL/SQL) - 05-27-2007 , 03:21 PM



<zigzagdna (AT) yahoo (DOT) com> wrote

Quote:
On May 27, 12:38 pm, "Jonathan Lewis" <jonat... (AT) jlcomp (DOT) demon.co.uk
wrote:
You may choose to have as many layers of code as
you like to transform the data from one valid state to
another valid state; but if you rely on programs to
maintain data correctness, you don't have a database,
you have a bit-bucket.

Not sure what do you mean by :"if you rely on programs to ....". PL/
SQL is a programming language so are C++ and Java. So you are writing
programs either way.

I was moving away from the rather trivial argument about
choice of language to the more important point about how
to handle data properly.

To clarify my point:

"If you rely on programs, irrespective of whether they are
written in PL/SQL, Java, C++ , or whichever you consider
to be the latest and greatest thing to stick on your C.V.
(resume for American readers) then you do not have a
database, you have a bit-bucket."

There are only two "tiers" - the data, and the presentation.
Any other layers you put between those two are in principle
only there to handle networking and queueing issues.

--
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html





Reply With Quote
  #134  
Old   
Gints Plivna
 
Posts: n/a

Default Re: Myth of the database independent applications (Was: Are you using PL/SQL) - 05-29-2007 , 04:31 AM



Quote:
Most of the software projects I worked on there are three layers (some
people call them tiers, tier does not mean
separate servers): User Interface, Business/Application Logic and
Database. User Interface simply does user interface, displays screens,
gets data from the user. Database stores data, there may be some
triggers, but database does not use any stored procedures. Business/
Application logic is where all the logic/algorthsm etc are
implemented. Business logic calls database to get data and update/
insert/delete data. Thus database code is little. Using OO techniques,
it is not all that difficult to write database classes in such as
fashion that they are mostly database independent. Sure there will be
some differences from one database to another, but differences are lot
less than if one was writing stored procedures in database
propritery language. Business logic can run on same server as
database server then network time is reduced drastically. Middleware/
interprocess communication provides efficient ways to communicate from
user interface to business logic and to distribure business logic into
many processes/threads. Business logic can use JDBC to connection to
databases if business logic language is Java.

I have worked so many projects using such architecture and performance
has never been an issue. For many software vendors it is more
important to be able to support many databases without writing lot of
database specific code than reducing performance times by taking
advantage every proprietery feature of a database.
There is also one thing that wasn't mentioned here - are you
developing applications that are usable by many customers i.e.
Products or you are developing app just for one customer with his
unique needs. If the first choice then there is at least a bit sense
to speak about database independence, if the second one, then
according to my experience databse independence is absolute nonsense
because I've never seen any customer changing his DB and keeping the
same application. Changing the DB always included redevelopment of app
always with much more and/or different functionality.
Now at least one another aspect why it is worth to have as much as
possible data integrity rules in DB - from my experience sooner or
later every customer tries either
1) to access directly db via some SQL statements
2) create his own smaller or bigger app doing something on the same
db.
And here integrity rules in db come in sight - without them there is
almost 100% possibility that sooner or later your data base will be
data waste.
I've done several data conversions from different data sources
starting from MS Access and ending with SQL Server and Oracle. What
I've always found is that without integrity rules I've got mess. The
only question was how big the mess was i.e. how many rows I had with
the broken logic? Fields that should be number but declared as char
always had some characters, fields that should have values Y, N
without proper control almost always had another values, tables
without FKSes had orphans, tables with some intercolumn logic not
declared in db always had this logic broken. The result for data
conversion process was either
1) lose the data
2) assume some default values.
So if one is ready to accept the fact that sooner or later he will
have some problems with data integrity then it is worth to forget
about data integrity rules and write business logic outside the db.
A summary of my thoughts about above mentioned things as well as
database independant apps one can find in my article Do you have data
waste or data base? at http://www.gplivna.eu/papers/data_wa..._data_base.htm

Gints Plivna
http://www.gplivna.eu



Reply With Quote
  #135  
Old   
joel garry
 
Posts: n/a

Default Re: Myth of the database independent applications (Was: Are you using PL/SQL) - 05-29-2007 , 01:50 PM



On May 27, 9:38 am, "Jonathan Lewis" <jonat... (AT) jlcomp (DOT) demon.co.uk>
wrote:
Quote:
zigzag... (AT) yahoo (DOT) com> wrote in message

news:1180257868.590456.84400 (AT) q69g2000hsb (DOT) googlegroups.com...



Three tier architecture is "standard" as well as good architecture
because it separates UI, Buisness Logic and database. UI only does UI,
database only stores data and busines slogic does the rest.

I've always been fascinated by the concept of business logic
being totally divorced from data correctness.
Yes, it is fascinating. At least some of the issue arises from the
impossibility of completely describing the business logic in a
short period of time.

Quote:
Either the data is a correct description of the state of
the business, or it is not - which means the "business
logic" is inherent in the data and enforced by the
constraints on the data.
Well, that's the "programmer's mistake." It will never be a 100%
correct description in many dynamic environments. For
example, there may be a variety of deals describing the sales
of a product to a customer, the attributes may change based
on the instincts of a salesperson in the field. Then the system
design is at least a step behind. To describe such attributes
within the database means having to be able to modify a large number
of constraints on a large amount of data in zero time. Not
to mention the analysis. And if you just ask management,
they are likely to say an attribute is "no sale will _ever_ be
below cost," until someone decides it's better to sell off the
old crap than pay for extra storage space or someone to
cart it away.

Some things are just better left to hacking.

Quote:
You may choose to have as many layers of code as
you like to transform the data from one valid state to
another valid state; but if you rely on programs to
maintain data correctness, you don't have a database,
you have a bit-bucket.

Three-tier is not an ideal to be aimed for, it is crutch to
be used as sparingly as possible until the database technology
is good enough to walk unaided.

But the older it gets, the more it needs a walker! :-)

jg
--
@home.com is bogus.
http://groups.google.com/group/comp....1?dmode=source



Reply With Quote
  #136  
Old   
www.douglassdavis.com
 
Posts: n/a

Default Re: Do you use PL/SQL - 05-30-2007 , 06:13 AM



Regarding the PL/SQL class:

just as an update for all of you concerned citizens out there:

not enough people signed up to make the class. I could possibly teach
it in the fall, so I will prepare for then.


If the class does have enough in the fall, I would like to focus on:
- making scripts to automate certain tasks
- making packages with procedures/functions
- making triggers
- making methods using the OO features of Oracle
(any other critical components?)

Since it will be taught in a computer lab, I will be focused more on
practical hands on type things than lecture.

Thanks for your help every one. I will run some more ideas past you
all later on.

Also, has any one read this book:
Oracle PL/SQL Best Practices Optimizing Oracle Code
By Steven Feuerstein

Is it good? Is it still relevant (it's a 2001 book)?


Reply With Quote
  #137  
Old   
ErikYkema
 
Posts: n/a

Default Re: Do you use PL/SQL - 05-30-2007 , 06:30 AM



On May 30, 1:13 pm, "www.douglassdavis.com"
<douglass_da... (AT) earthlink (DOT) net> wrote:
Quote:
Regarding the PL/SQL class:

just as an update for all of you concerned citizens out there:

not enough people signed up to make the class. I could possibly teach
it in the fall, so I will prepare for then.

If the class does have enough in the fall, I would like to focus on:
- making scripts to automate certain tasks
- making packages with procedures/functions
- making triggers
- making methods using the OO features of Oracle
(any other critical components?)

Since it will be taught in a computer lab, I will be focused more on
practical hands on type things than lecture.

Thanks for your help every one. I will run some more ideas past you
all later on.

Also, has any one read this book:
Oracle PL/SQL Best Practices Optimizing Oracle Code
By Steven Feuerstein

Is it good? Is it still relevant (it's a 2001 book)?
(Almost) everything by Steven Feuerstein is good. However I do
recommend his Oracle Pl/Sql Programming 4th edition volume, I am
almost certain that that completely supersedes the 2001 book.
Regards, Erik



Reply With Quote
  #138  
Old   
EscVector
 
Posts: n/a

Default Re: Do you use PL/SQL - 05-30-2007 , 08:57 AM



On May 30, 7:13 am, "www.douglassdavis.com"
<douglass_da... (AT) earthlink (DOT) net> wrote:
Quote:
Regarding the PL/SQL class:

just as an update for all of you concerned citizens out there:

not enough people signed up to make the class. I could possibly teach
it in the fall, so I will prepare for then.

If the class does have enough in the fall, I would like to focus on:
- making scripts to automate certain tasks
- making packages with procedures/functions
- making triggers
- making methods using the OO features of Oracle
(any other critical components?)

Since it will be taught in a computer lab, I will be focused more on
practical hands on type things than lecture.

Thanks for your help every one. I will run some more ideas past you
all later on.

Also, has any one read this book:
Oracle PL/SQL Best Practices Optimizing Oracle Code
By Steven Feuerstein

Is it good? Is it still relevant (it's a 2001 book)?
Search for "Do the Fast Thing"
A very good Feuerstein presentation on Bulk Collect, FORALL and IN
INDICES OF demo.
Also new and improved PL/SQL datatypes.

And make sure to get the 4th edition http://www.bookpool.com/sm/0596009771



Reply With Quote
  #139  
Old   
EscVector
 
Posts: n/a

Default Re: Do you use PL/SQL - 05-30-2007 , 08:59 AM



On May 30, 9:57 am, EscVector <J... (AT) webthere (DOT) com> wrote:
Quote:
On May 30, 7:13 am, "www.douglassdavis.com"



douglass_da... (AT) earthlink (DOT) net> wrote:
Regarding the PL/SQL class:

just as an update for all of you concerned citizens out there:

not enough people signed up to make the class. I could possibly teach
it in the fall, so I will prepare for then.

If the class does have enough in the fall, I would like to focus on:
- making scripts to automate certain tasks
- making packages with procedures/functions
- making triggers
- making methods using the OO features of Oracle
(any other critical components?)

Since it will be taught in a computer lab, I will be focused more on
practical hands on type things than lecture.

Thanks for your help every one. I will run some more ideas past you
all later on.

Also, has any one read this book:
Oracle PL/SQL Best Practices Optimizing Oracle Code
By Steven Feuerstein

Is it good? Is it still relevant (it's a 2001 book)?

Search for "Do the Fast Thing"
A very good Feuerstein presentation on Bulk Collect, FORALL and IN
INDICES OF demo.
Also new and improved PL/SQL datatypes.

And make sure to get the 4th edition http://www.bookpool.com/sm/0596009771
Another good presentation:
http://oracleplsqlprogramming.com/Pr...BestPLSQL.html



Reply With Quote
  #140  
Old   
DA Morgan
 
Posts: n/a

Default Re: Do you use PL/SQL - 05-30-2007 , 10:03 AM



www.douglassdavis.com wrote:
Quote:
Regarding the PL/SQL class:

just as an update for all of you concerned citizens out there:

not enough people signed up to make the class. I could possibly teach
it in the fall, so I will prepare for then.


If the class does have enough in the fall, I would like to focus on:
- making scripts to automate certain tasks
There is essentially no reason for automating tasks using scripts in
10g and beyond. Task automation should be done in the OEM Grid Control
or using DBMS_SCHEDULER.

Quote:
- making packages with procedures/functions
And learning how to use the initialization section and the implication
of serially reusability on packages.

Quote:
- making triggers
Table triggers?
Instead-of triggers?
DDL Event triggers?
System Event triggers?

Quote:
- making methods using the OO features of Oracle
(any other critical components?)
Read Tom Kyte's commentary on Oracle's OO features. My recommendation
would be to stay away from them with the sole exception being object
views with instead-of triggers.

Quote:
Since it will be taught in a computer lab, I will be focused more on
practical hands on type things than lecture.
You can not separate the two. If the point is to teach syntax then
they don't need you ... just a web connection. The point of being
an instructor is to discuss best practice ... why BULK COLLECT and
FORALL rather than CURSOR FOR LOOPS. What are the practical implications
of PRAGMA AUTONOMOUS TRANSACTION. When to use positional rather than
named parameter notation. What the differences are between passing
parameters by reference with NOCOPY.

Quote:
Thanks for your help every one. I will run some more ideas past you
all later on.

Also, has any one read this book:
Oracle PL/SQL Best Practices Optimizing Oracle Code
By Steven Feuerstein

Is it good? Is it still relevant (it's a 2001 book)?
Steven's book is good. But read Tom Kyte's books first for the
necessary background.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.