title: Chess program OO design
body: <p>In my chess program, I have a class called Move. It stores where the piece was taken and put. What was the piece and what was the piece captured.</p>
  
  <p>The problem is though, in order to get the piece that was moved and captured, I pass the whole Board object to the __init__ method. And so IMO it seems like I should store all the Move class methods to the Board class instead, which too has a method that get's the piece on a given square.</p>
  
  <p>I'm just beginning to learn OO, so some advice regarding this, and maybe some more general design decision is much appreciated.</p>
  
  <p>Here's the Move class that I feel might better be omitted?</p>
  
  <pre><code>class Move(object):
  
      def __init__(self, from_square, to_square, board):
          """ Set up some move infromation variables. """
          self.from_square = from_square
          self.to_square = to_square
          self.moved = board.getPiece(from_square)
          self.captured = board.getPiece(to_square)
  
      def getFromSquare(self):
          """ Returns the square the piece is taken from. """
          return self.from_square
  
      def getToSquare(self):
          """ Returns the square the piece is put. """
          return self.to_square
  
      def getMovedPiece(self):
          """ Returns the piece that is moved. """
          return self.moved
  
      def getCapturedPiece(self):
          """ Returns the piece that is captured. """
          return self.captured
  </code></pre>