[ next ] [ prev ] [ contents ] Connascence and Java

Connascence of Value (dynamic)

Connascence of value occurs when the values of two components are related.

Example

  
class Retangle {
    private int left;
    private int right;
    private int top;
    private int bottom;

    // Constraint: left < right
    // Constraint: top > bottom
}

Example

  
class Queue {
    private int myHead;
    private int myTail;

    // myHead == myTail    =>  Queue Empty
    // myHead+1 == myTail  =>  Queue Full (modulo arithmetic)
}


[ next ] [ prev ] [ contents ] Copyright 2001 by Jim Weirich.
All rights reserved.