File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unit Interfacing" Watch "Unit Interfacing" New topic
Author

Unit Interfacing

Hisouka Devera
Greenhorn

Joined: Oct 16, 2012
Posts: 28
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?

Regards
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
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: 605

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: http://aspose.com/file-tools
 
subject: Unit Interfacing