Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-01-2004, 04:13 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,486
sde is on a distinguished road
Application variables

I am really trying to use as little data queries as possible on this project because I want to make this app as fast as it can be.

i have about 20 users who use this application. they are a class 'agent'

my app gets issues from the issue table which has an agent id.

let's say i have an array of issues, .. if i want to display the username of the agent who was on the issues as i loop through them, i need to make another query for each issue.

is it possible to setup an application level variable that stores an array of my agents? then i could get their id by using their id as the array key.

agent[issue.getAgentID()]['username']

or something like that. i was thinking this or just adding another field in the issue table that stores the username. i didn't want to do this as it is not the best practice for a relational database.

any thoughts on this?
__________________
Mike
sde is offline   Reply With Quote
Old 09-01-2004, 04:21 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
When getting the issues from the database, why don't you simply cross the query with the agent table? Then when you create the Issue object (which I assume is an object), simply fill in the agent's name?
__________________
GitS
Belisarius is offline   Reply With Quote
Old 09-01-2004, 04:30 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,486
sde is on a distinguished road
my issue class and agent class are seperate, . then i have an issue db class and an agent db class which handle their own db interaction to get their own info.

i was trying to keep it seperate, but i guess you're right, maybe i should break my strict enforcement of crossing classes for db queries.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application Scope in a Web App sde Java 5 08-17-2004 09:55 AM
downloading the java sdk without the sun application server? sde Java 2 08-02-2004 07:53 AM
Dynamic variables in C#? sammy MS Technologies ( ASP, VB, C#, .NET ) 10 06-22-2004 02:22 AM
What makes a network application? sde Program Design and Methods 3 08-03-2003 05:19 PM


All times are GMT -8. The time now is 08:14 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting