Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Use of objects and associated performance hit?

Author: Peter McKenzie

Date: 21:24:32 12/30/99

Go up one level in this thread


On December 30, 1999 at 18:53:04, Tom Kerrigan wrote:

>Although I love C and I usually don't approve of object-oriented programming, I
>think there are compelling reasons to use objects in a chess program.
>
>Specifically, I want to have a chess board class, which contains the data and
>functions necessary to manipulate a chess board. I also want to have an engine
>class, which extends the chess board class, and adds the functions necessary to
>search the board.

Slightly off topic, but why do you want to make your engine class a subclass of
your board class?  This seems a little weird from an O.O design perspective as
usually subclassing implies an 'is-a' relationship (chess engine is-a chess
board?!).  More natural to me would be to make the chess board an attribute/data
member/instance variable of the chess engine.

>
>I have two questions:
>1. When I access the chess board class from the engine class, will there be a
>performance hit?
>2. If I have multiple instances of the engine class, can each one run on a
>different processor without a performance hit?
>
>Thanks,
>Tom



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.