Menu

#2 Lack of cohesion and getters + setters

open
nobody
None
5
2005-12-19
2005-12-19
Anonymous
No

It would be nice if the configuration for the lack of
cohesion would be able to exclude getters and setters.

Currently classes with lots of getters and setters have
horrendous scores with the Henderson-Sellers lack of
cohesion.

you may contact me at :
simon.vaillancourt@gmail.com

Discussion

  • Lance Walton

    Lance Walton - 2007-03-26

    Logged In: YES
    user_id=132616
    Originator: NO

    Hi.

    The problem I have with this is that getters and setters are a problem, unless they are for architectural reasons (like DTOs for EJB systems), or for self-encapsulation.

    If the reason you want this is the former, I suggest excluding the classes by using a naming convention and the Properties / Metrics / Excluded Resources functionality. If its the latter, then it's a more interesting problem which I'll ponder.

    Regards,

    Lance

     
  • Simon Vaillancourt

    Logged In: YES
    user_id=1779400
    Originator: NO

    Actually, most of my classes that has that problem are beans, so I've had no choice but to excluded them long time ago.

    Maybe an annotation on the methods that allow to exclude any type of metrics would do the trick. Kind of saying : I know that this methods sucks but I have no choice. Because now I always come back to the same methods at the top of my reports and I cannot justify to rewrite lots of code of my fellow coworkers because I hate to see red in my reports.

    Love your plug-in though. I'm kind of addicted to it and evangelize it's use as often as I can.

    Simon V.

     

Log in to post a comment.