This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unit Interfacing

 
Hisouka Devera
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49776
69
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic