This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
If I code, lets say, retrieval from a database a list of records that match some criteria. I can do this basically one of two ways, a) Servlet that runs a query, populates a bean and then displays in a JSP -OR- b) do the lot in the JSP. Which is faster? Does one consume significantly more resources than the other? Let's ignore for the purpose of this post usual MVC benefits (maintenance & separation of duties etc).
Typically you should see any performance differences from how the logic is broken out are minimal compared to the overhead of the network and database connections. When the overhead for keeping things well-structured actually causes significant performance degradation in the server, it's probably time to consider a faster language than Java! Finally, there's the cardinal rule for optimization: It's virtually ALWAYS easier to optimize a well-structured program than it is to debug an "optimized" one. Along with its corrollary: The bottleneck is almost NEVER where you "know" it is.
Being persecuted doesn't in any way prove your righteousness or your beliefs. Many people get persecuted because they are repugnant or annoying. Or just because they can be.
I am fairly new to server side java... are you saying that sometimes it is OK and won't hurt performance if you lump everything into the JSP, assuming maybe it is a very small app with not much worry about code maintanence?
Zac Roberts<br />SCJP2
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad: