• Post Reply Bookmark Topic Watch Topic
  • New Topic

Huge POJO's in Web App

 
Harshavardhan Joshi
Greenhorn
Posts: 8
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am developing a web app which has a POJO class in it.

That pojo is responsible for getting the records from the DB n populating the Collection object n return the same.

The methods in pojo are called by different JSP's and that pojo has grown huge enough(1600 lines.)

So my question is that, can this pojo hamper the app performance?

Thanks.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Harshavardhan!

If 1600 lines of code was a performance-killer in J2EE, none of my webapps would work. I prefer smaller classes, but I don't always get what I prefer.

Obviously, for maintenance reasons, you'll want to keep classes small and simple, but the number of raw lines of code isn't really what counts. What counts is what the code does and how many resources it consumes while doing it. I could write a 20-line class that gobbled up 100MB of ram and sat on it for 5 minutes and it would do far more damage than any 10 1600-line classes that were better behaved.
 
Harshavardhan Joshi
Greenhorn
Posts: 8
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!