Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How large is your class file?

 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My data class implements DBAccess and have all the supplemental methods needed at the access layer. With no comments, it mounts to 800+ lines. Is this too large so that I need to break down?

Thanks
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy,
A class with 800 lines of code is not a big class. Don't worry too much about the size of the code, worry more about the style, organization, simplicity, and comprehension.
 
Mike Vess
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Copied from an article at JavaWorld:
My rule of thumb states that 500 lines of code amounts to a big class. Classes over 1,000 lines are bad and must be fixed, and classes over 2,000 lines equal acts of terrorism.
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Hanna and Mike:

the citation makes some sense to me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic