title: Manually setting object's position or have the object do it all?
body: <p>I'm stuck thinking about the best way to go about setting a line segment's position, I have a class Line(length, angle, previous) being called from a class Polygon.. Right now I have:</p>
  
  <pre><code>public class Line extends Sprite {
      public function Line(length:Number, angle:Number, previous:Line = null) {
          if (previous != null) {
              this.x = previous.end.x;
              this.y = previous.end.y;
          } else {
              this.x = 0;
              this.y = 0;
          }
          /**/
      }
  }
  </code></pre>
  
  <p>Now, is this the best practice or should I be doing:</p>
  
  <pre><code>Polygon.addLine(length:Number, angle:Number):void {
      var previous = (_line.length == 0) ? null : _line[_line.length - 1]; // Array containing all Lines
      var line:Line = new Line(length, angle, previous);
      line.x = (_line.length == 0) ? 0 : previous.end.x;
      line.y = (_line.length == 0) ? 0 : previous.end.y;
      /**/
  }
  </code></pre>
  
  <p>One thing to add, Line is only used by Polygon in this application.</p>