I have been developing web/desktop applications for about 6 years now. During the course of my career, I have come across application that were heavily written in the database using stored procedures whereas a lot of application just had only a few basic stored procedures (to read, insert, edit and delete entity records) for each entity.
I have seen people argue saying that if you have paid for an enterprise database use its features extensively. Whereas a lot of "object oriented architects" told me its absolute crime to put anything more than necessary in the database and you should be able to drive the application using the methods on those classes?
Where do you think is the balance?
Thanks, Krunal
DATA logic should be in the database. The way you manipulate the database structures to perform the activities required by the functionality SHOULD BE held in the database. When you join up these activities into a larger series of processes (business logic) then THIS can be consolidated in the application.
'connS' contains the connection string. This is what allows an application to open a connection and execute a SQL query with a database. Within it, you can see that the server and database names are provided, as well as what credentials are needed (same ones used to access the database via SSMS).
Do you always need a database for your app? Of course not. As with everything in technology, nothing is ideal in every situation. Computers offer many various ways to store data.
Oracle Database offers the ability to store program code in the database. Developers write program code in PL/SQL or Java, and store the code in schema objects. You, as the DBA, can use SQL Developer to manage program code objects such as: PL/SQL packages, procedures, functions, and triggers.
I think it's a business logic vs. data logic thing. If there is logic that ensures the consistency of your data, put it in a stored procedure. Same for convenience functions for data retrieval/update.
Everything else should go into the code.
A friend of mine is developing a host of stored procedures for data analysis algorithms in bioinformatics. I think his approach is quite interesting, but not the right way in the long run. My main objections are maintainability and lacking adaptability.
I'm in the object oriented architects camp. It's not necessarily a crime to put code in the database, as long as you understand the caveats that go along with that. Here are some:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With