Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CD Lessons in Production

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the local state university, we're about to put into production a simple web app developed following the lessons of the Cattle Drive. While the app will have hundreds of users, it will likely never have more than a dozen concurrent users.
It occurs to me that I might want to ask if there is anything about the JDBC or Servlets assignments that was strictly for learning purposes and shouldn't be implemented in even a small-scale/small-volume web app. So, is there anything to look out for?
 
paul wheaton
Trailboss
Pie
Posts: 21344
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you familiar with concurrancy issues?
I think the big thing you will need to think about is what if two people try to use the same servlet at the same time. The main thing is that you don't want to use "global variables" - don't store something as a servlet attribute and have methods within the servlet depend on that information. In other words, don't set such an attribute to a value then call a method that depends on that value. It's possible that another user is using the same servlet at the same time and is setting the same variable to something else!
It was a long time ago that I wrote those assignments. So I can't remember that much about them. But off the top of my head, I would guess that they would be okay.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm only up to Servlets-4b but so far there seems to be no requirement for synchronization on the list used for the Video Library. I did put it in but got hints that I shouldn't do it because users were well mannered.
Also there is one "global" library, not one for each user.
There is just one password to access the servlets and it is hardcoded and unencrypted.
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't think of anything that should not be implemented. It would probably be wise to add/modify a couple of things for real life use even though they're above and beyond the assignment requirements. Passwords and concurrent access are on top of the list. If you have a small number of users, you probably won't need to get into connection pooling.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic