File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Unit Interfacing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unit Interfacing" Watch "Unit Interfacing" New topic

Unit Interfacing

Hisouka Devera
Ranch Hand

Joined: Oct 16, 2012
Posts: 30
Hi Guys,

We made an application using Java.. But we received a suggestion that we need to improve on this:

Unit Interfacing: The percentage of lines of code residing in units with 3 or more parameters should not exceed 15%. The percentage in units with 5 or more parameters should not exceed
4%. The percentage in units with 7 or more parameters should not exceed 0.8%.

Can you help me?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45359
That means the people writing that think that methods with many parameters are a bad idea. They suggest you refactor the code to have more methods with fewer parameters.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 607

For a large program those number seem a bit harsh.
Of course you can always use your IDE to refactor away "multiple paramaters" into an object. I would agree that as a practice it is a good idea. Having said that, I don't think it should be used blindly. Re-factor when it sensible.

Those # are going to be hard. Do you know if these standards are being picked up from somewhere?

That's the first time I heard of the term called Unit Interfacing. Any pointers to resource with more information or definition of it?

Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
I agree. Here's the link:
subject: Unit Interfacing
jQuery in Action, 3rd edition