better approach.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sumittyagi
    Recognized Expert New Member
    • Mar 2007
    • 202

    #1

    better approach.

    I am confused in a scenario, where I am having 2 alternatives(ma y be more but I am able to think of only two), which one to choose from these two (or may be any other better approach)?

    Secnario is as follows:
    I have to fetch data from table database according to some filters, and then display it on the screen.

    Now one way is to take the filters in comma-separated values(or may be any special symbol separated values), and split them to String[], and set that object to session.

    Second way is make an info class according to the data fields to be displayed, and take an store an array object of info type in session.

    Thanks in advance for any help.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by sumittyagi
    I am confused in a scenario, where I am having 2 alternatives(ma y be more but I am able to think of only two), which one to choose from these two (or may be any other better approach)?

    Secnario is as follows:
    I have to fetch data from table database according to some filters, and then display it on the screen.

    Now one way is to take the filters in comma-separated values(or may be any special symbol separated values), and split them to String[], and set that object to session.

    Second way is make an info class according to the data fields to be displayed, and take an store an array object of info type in session.

    Thanks in advance for any help.
    A class that mirrors the data in the table is always a good thing to have for more convenient retrieving e.t.c, however, it depends on how often you are going to be changing the data (if at all). i.e If you add a new column then you need to change your class(this is not required if you use the first approach)

    Comment

    • sumittyagi
      Recognized Expert New Member
      • Mar 2007
      • 202

      #3
      Originally posted by r035198x
      A class that mirrors the data in the table is always a good thing to have for more convenient retrieving e.t.c, however, it depends on how often you are going to be changing the data (if at all). i.e If you add a new column then you need to change your class(this is not required if you use the first approach)
      Thanks a lot r035198x, I got the point.

      Comment

      Working...