Home » Other » General » A little advice about business logic (9i R2)
A little advice about business logic [message #568132] Tue, 09 October 2012 12:17 Go to next message
Amine
Messages: 259
Registered: March 2010
Senior Member

Hi all,
I used to write PL/SQL packages every time I can.

I am agree with Tom Kyte when he says "The Database is my operating system". From my point of view, centralizing the business logic into the DB is the best way
to build successfull applications.
I had a discussion with an Java EE developper, and we were not at the same wave length about that : he said that buisiness logic should be encapsulated "into Java"
(i.e transactionnal operations will be done with Java).

I am not a Jave EE specialist (only a little SE) but once again, Tom Kyte mentions one time in AskTom that "a good Java program does no :insert, update, delete neither select".

We are moving our applications progressively from F&R 6i to F&R 11g then, may be, to ADF. I am a little bit confused with that, can you light the way for me ?

Thanks in advance,

Amine
Re: A little advice about business logic [message #568135 is a reply to message #568132] Tue, 09 October 2012 12:33 Go to previous messageGo to next message
Michel Cadot
Messages: 58612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The answer is obvious, a Java developer does not know the database so he does not trust it and so he wants to manage everything.
The closer to the data is the treatment the more performant and safer it is.

See an example about sanity/reliability. A user is able to update a table in the application, this one made some verifications to prevent the user from doing some "wrong" (in the application meaning) updates. OK. Now the user connects directly to the database (any way he is able to do it), he can do any updates he wants.
Another one: do you let the application make all primary key, referential integrity and check constraints? What does it happen if 2 users do the same thing at the same time? Or if 2 applications accessing the same data does it? How to be sure they have implemented the same rules?...

Now about performances, will you get all the data and do all aggregate computations in the application or let the database do it and only return the computation result? OK, it is a caricature but it is the spirit of the point.

Regards
Michel
Re: A little advice about business logic [message #568137 is a reply to message #568135] Tue, 09 October 2012 12:42 Go to previous messageGo to next message
Amine
Messages: 259
Registered: March 2010
Senior Member

So, what, in general, is the best way : encapsulate logic in DB or through a 3GL such as Java ?
Re: A little advice about business logic [message #568141 is a reply to message #568137] Tue, 09 October 2012 12:50 Go to previous messageGo to next message
Michel Cadot
Messages: 58612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What do you think from what I said?

Regards
Michel
Re: A little advice about business logic [message #568147 is a reply to message #568141] Tue, 09 October 2012 13:16 Go to previous messageGo to next message
Amine
Messages: 259
Registered: March 2010
Senior Member

There's a lot of axes of comparison. Performance is one of them and you've talked about.
The aim of my question was about the way we encapsulate logic in a system (application layer + data layer (database in our case) ). I've launched a discussion on LinkedIn to and Justin's answer is near to my expectations Smile http://www.linkedin.com/groupItem?view=&gid=74566&type=member&item=173444932&qid=2e6a1869-2e3e-4caa-8939-7f0c658f9ae4 &trk=group_most_popular-0-b-ttl&goback=%2Egde_74566_member_173444932%2Egmp_74566
Re: A little advice about business logic [message #568148 is a reply to message #568147] Tue, 09 October 2012 13:26 Go to previous messageGo to next message
Michel Cadot
Messages: 58612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes he says about the same thing than I said but with a much better english.

Regards
Michel
Re: A little advice about business logic [message #568152 is a reply to message #568148] Tue, 09 October 2012 16:13 Go to previous message
Amine
Messages: 259
Registered: March 2010
Senior Member

here is Tom Kyte answer

Quote:
here is my short reply:

business logic is fine in the middle tier.

*data logic*, stuff that manipulates data, should be in the *data*
tier. If you want reusable code - put it in the database - anything can
use and reuse that. want web services? push a button - we'll publish
it as a web service. need it in java, great, you have jdbc. need it in
php, ruby, perl, C, C++, whatever - great - they can all do it natively.
Previous Topic: How(Where) to get Oracle Transparent gateway for sql server
Next Topic: Steps to create an account in metalink
Goto Forum:
  


Current Time: Tue Jul 29 20:47:02 CDT 2014

Total time taken to generate the page: 0.09582 seconds