• Post Reply Bookmark Topic Watch Topic
  • New Topic

business logic (in java or PL/SQL)?  RSS feed

 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where should I put business logic in a really heavy application???
If I use PL/SQL I won't be able to have reusable code, and all benefits of object oriented programing, but if I have all business logic writen in java
the software programing will be very easy but things may get slower...
What is the right thing to do?
Thanks in advance!!!
 
Anurag Gupta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your DataBase is Designed correctly (Indexes etc), and if you are using Connection Pooling of a Good Driver, then Running PL/SQL(Business Logic) using JDBC would not be slow.
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is really well designed!!! But I would Like to know what is being used by the programmer community... Here in Brazil most companies focus on PL/SQL, but I don't think it is a good way to program... I preffer working focusing most with java and jdbc...
Am I doing right?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would hesitate to put much logic into PL/SQL, but I don't know much about the topic, anyway.
Perhaps you should take a look at Java Stored Procedures?
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use a bit of the power of StoredProcedures but I don't rely much on this, since it's not very reusable...
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leandro oliveira:
Yes, it is really well designed!!! But I would Like to know what is being used by the programmer community... Here in Brazil most companies focus on PL/SQL, but I don't think it is a good way to program... I preffer working focusing most with java and jdbc...
Am I doing right?

I used to favor doing as much as possible in PL/SQL, but that's because I came from the early client-server world where doing it in VB or PowerBuilder just wasn't practicle performance-wise.
Now, however, with large web applications, the database is quickly becoming the bottleneck. By moving the business logic out of the database and into Java, the DB is left only having to do CRUD (create, read, update, delete) operations which are quite fast. Then you throw more appservers against the same DB to handle the load and you're all set. Not only that, but you would have an easier time porting to a new DB if necessary.
 
Bob Watson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just what I've seen.
1. In security perspective, if you use PL/SQL, then your business logic won't be transferred over your network.
2. On the other hand, from J2EE structure point of view, each Java bean should match one table and we implement all the functionalities associated with that table inside this Java Bean. If you want to use PL/SQL, you are more flexible in reducing Java bean usage.
In the real industry, both are popular.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!