A A A i

billet précédent :: billet suivant

Information decay

Returning on the hungarian notation for Java, one very important thing to consider is how to maintain coherent information. If you don't pay attention to maintain your "fbsStatus" and other "hcnChilds" up to date with their real type and use across the refactoring cycles, it's more a danger than a help. That means we must have a dimension of variable naming in the refactoring patterns.

Let's take a simple example. A property "available" has a boolean type and its no more sufficient for the exemple use, so you change its type to int.

boolean m_bAvailable => int m_bAvailable

In parallel, you must rename it.

int m_bAvailable => int m_nAvailable

The type has changed, you must change the accessors.

void setAvailable(boolean p_bAvailable) => void setAvailable(int p_nAvailable)
boolean isAvailable() => int getAvailable()

And then change the calling code, that is change the variable types and names where applicable. The complexity of this refactoring is almost doubled compared with the one without hungarian notation. So we need style checker which can handle this (I wonder if Checkstyle does it?). By the way, there is a little problem now, "getAvailable" doesn't sound right at all, it should be "getAvailability", *sig*. (Cyberpunk, 2002/12/03 05:38) lien permanent

Les commentaires pour ce billet sont fermés.


qui est

nom : Damien Bonvillain
courriel : kame à cinemasie.com
bloggercode:
B9 D+ T+ K S F I- O X+ E- L- C-- Y1 R+ W- P+ M5 N-- N+
un peu plus : Google Whoring tortue

Messagerie instantanée

    les koms

    m'enfin

    Quant à mes invectives imaginaires, je vous laisse chercher un endroit adéquat pour les ranger. Elles craignent la lumière, si vous voulez une piste.
    Lien associé
    Eolas - « Aimez moi, c'est un ordre. »

    les bons vieux


    archives

    « décembre 2002 »
    lunmarmerjeuvensamdim
    1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031

    XML RSS 2.0 XML RSS 2.0 commentaires A A A i

    liens

    allégeance

    Blog sans chat

    colophon

    Propulsé par pointClairMerci à la caféineDevelopment with EmacsBadges from GTMcKnightFreeListed on BlogSharesGeoURL