aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S Is 900 lines Of Source In One File Too Much? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S Is 900 lines Of Source In One File Too Much?" Watch "B&S Is 900 lines Of Source In One File Too Much?" New topic
Author

B&S Is 900 lines Of Source In One File Too Much?

Bob Nedwor
hangman
Ranch Hand

Joined: Aug 17, 2005
Posts: 215

It is the class that does most of the GUI work. I don't see how I can break it apart. Functionally, it looks like it should all be in the same class.

If I tried to break it up, there would be lots of duplication and I would probably have 2 650-700 line files.

How many lines do you guys have in your biggest .java file ?


Bob N
SCJP - 1.4
SCJD - (B&S) Used 1.5 And It Runs On Solaris10
SCWCD - Thanks to HFSJ!!
Ed Tse
Ranch Hand

Joined: Sep 18, 2003
Posts: 183
If you didn't use the MVC pattern, It might be harder to break your code up.

If you did use MVC pattern, you can put panels into different classes(have those classes extend JPanel) and pass the the controller to those class for functionality.

Another way to break it up is to put classes that implements listeners other classes. (Again, pass your controller over to those classes)

But 900 line classes are acceptable (My opinion as I have seen a lot of classes w/ 900lines)
[ March 24, 2006: Message edited by: Ed Tse ]

SCJP, Pre-SCJD (URLyBird 1.3.1), Teradata Cert'd Prof
Bob Nedwor
hangman
Ranch Hand

Joined: Aug 17, 2005
Posts: 215

Ok, Thanks Ed. Yes I am using MVC. So I think I can break it out to one class per major panel.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S Is 900 lines Of Source In One File Too Much?