GeeCON Prague 2014*
The moose likes JSP and the fly likes JSP's or MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Watch "JSP New topic
Author

JSP's or MVC

Bhavani Sankar Ikkurthi
Greenhorn

Joined: Aug 07, 2008
Posts: 8

We have a project which contains huge database in Oracle. The application is totally built in PL/SQL[using HTP package].
Now the client wants a lighter version of the application to be used offline.
As oracle lite is compatible with Java.. we are developing one more application converting all Oracle procedures to JSP pages.

We are writing queries in the scriplet tags in the JSP's itself. Is it a good idea??
Does implementing MVC architecture to this project take more time to fetch many records from the DB and traverse them over the model classes.Does that take more time against fetching records from DB using queries in scriplets in JSP.

If we need to follow some other architecture then which is better?? The queries will be returning some thousands of records as resultset.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

We are writing queries in the scriplet tags in the JSP's itself. Is it a good idea??

NO.

If nothing else, separate the view from the DB logic. Even when not using an ORM layer it's a really good idea to keep Java code in Java, and view code in JSP.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Just in case David's response didn't register strongly enough:

NO

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Bear Bibeault wrote:Just in case David's response didn't register strongly enough:

NO


Any performance difference in properly structured code will be negligible.
Sunder Ganapathy
Ranch Hand

Joined: Apr 01, 2003
Posts: 120
I enjoy Bear's replies. Simply superb. Never hesitates to hit the nail on its head.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

No one's ever accused me of being a shrinking violet.

Seriously, I think it's important to get the point across that following poor practices to solve a performance "problem" that probably doesn't even exist is not a great idea.
Sunder Ganapathy
Ranch Hand

Joined: Apr 01, 2003
Posts: 120
Actually, following these simple rules, helps not only creating easily maintainable software, it also helps in
creating customer delight, the single purpose for which the software was originally brought into existence, with an
additional add on, of increased bank balance for both the customer and the software creator, due to better
performance.
Bhavani Sankar Ikkurthi
Greenhorn

Joined: Aug 07, 2008
Posts: 8

Thank you very much all.
Billy Korando
Greenhorn

Joined: Sep 18, 2009
Posts: 15
Bhavani Sankar Ikkurthi wrote:We have a project which contains huge database in Oracle. The application is totally built in PL/SQL[using HTP package].
Now the client wants a lighter version of the application to be used offline.
As oracle lite is compatible with Java.. we are developing one more application converting all Oracle procedures to JSP pages.

We are writing queries in the scriplet tags in the JSP's itself. Is it a good idea??
Does implementing MVC architecture to this project take more time to fetch many records from the DB and traverse them over the model classes.Does that take more time against fetching records from DB using queries in scriplets in JSP.

If we need to follow some other architecture then which is better?? The queries will be returning some thousands of records as resultset.


How absolutely important is performance? Are we talking a system that has very heavy usage with very little resources? Because unless this is the case (and I can almost guarantee you it isn't) maintainable code should take precedence over performance. As is there is only a few real bottlenecks in any program, e.g. DB calls, at which point is when you can have messy code if it does make a performance difference (and that difference justifies the messy code).
 
GeeCON Prague 2014
 
subject: JSP's or MVC