views:

52

answers:

1

Hi
I am a part of a student programming group an we are programming a social networking site.

I have a Session bean and for every User i create a UserInfoHolder Class and my Session bean has an Instance of it. So 1 User = 1 UserHolder Instace = 1 Big Database query .. when logging in.

Another Design Approach would be : No Holders. Direct Connection to Database in every Session Bean Method => 1 User = 40 Database queries, no JavaClasses in Backgroud

My Question is :
Which One is the better Choice ?
I think .. having 5000 InfoHolder(5000 Users simultanously logged in) Classes might be a little bit too much. :/

What do you think ?

A: 

Your design should always aim to minimize the number of database queries since database is the a bottleneck whereas users session, so your UserInfoHolders, can be easily distribuited along many servers.

dfa