Performance question

Performance question

  
Hello all,
this is probably not my sharpest question but...what is better, to rely on database access or to "walk around" with a number of arguments?

I ask this because in some cases I use an action in a webscreen to query a certain DB to get a certain value, and in the next screens some of the attributes i also got with that query will also be used. Is it better to make queries on each screen to get specific values or, in the first query get all the attributes and pass them onto the next web screens as arguments.

This is merely to increase the performance of my application.


Thank you in advance.
Hi Rui,

In my experience I found out that I prefer to do queries in each screen, the issues I see with using values as parameters:
  • gets messy really quick (always adding non mandatory input parameters which you then forget what they are supposed to do in a week...)
  • can lead to "strange" errors in screens just because you forgot to assign a variable in some link
  • maintainablility is gonna be tough...
  • new users looking at the code will say "what was this guy thinking when he put 30 input parameters?" :)
Hope it helps,
Hermínio Mira
Rui Molefas wrote:
 in some cases I use an action in a webscreen to query a certain DB to get a certain value, and in the next screens some of the attributes i also got with that query will also be used. Is it better to make queries on each screen to get specific values or...
 
 Rui, 

forget the or part. It's better to do simple queries in the screens because the platform will tune the query in order to get only the used attributes in that screen otherwise you'll retrive all attributes in the entities existing in that query.

Cheers, 
Ricardo
Thanks a lot for your replies!
Hermínio Mira wrote:
Hi Rui,

In my experience I found out that I prefer to do queries in each screen, the issues I see with using values as parameters:
  • gets messy really quick (always adding non mandatory input parameters which you then forget what they are supposed to do in a week...)
  • can lead to "strange" errors in screens just because you forgot to assign a variable in some link
  • maintainablility is gonna be tough...
  • new users looking at the code will say "what was this guy thinking when he put 30 input parameters?" :)
Hope it helps,
Hermínio Mira
 
Don't forget the security issue (url manupilation).

Ricardo Araújo wrote:
 
 Rui, 

forget the or part. It's better to do simple queries in the screens because the platform will tune the query in order to get only the used attributes in that screen otherwise you'll retrive all attributes in the entities existing in that query.

Cheers, 
Ricardo
 
Ricardo, please don't say it like it's always tuned by the platform, there are some rules before that is done....

Kind regards,
Evert