Object Oriented Design – Genome Class / Mutation Class


I am having an argument with my friend on how to start implementing a Genetic Algorithm called NEAT (NeuroEvolution of Augmenting Topologies).

Method 1

I am arguing in favor of having two classes, one for Genome and one for Mutation. This Mutation class will provide methods for mutating genomes by taking a genome as input and returning a mutated genome. Furthermore, this implementation will have classes for each process like Selection, Crossover etc.


  • This way we will have the option to derive from Mutation class later on to implement various kinds of mutations.
  • I think it will also help with better unit testing.


  • More classes
  • Does not model real life (for example, a human can walk like a genome can mutate)

Method 2

My friend wants to have only one class for this, the Genome class. In this implementation mutate will be a method of Genome class which will return a mutated genome as output.


  • This will help reduce complexity.
  • It will also model that a genome can mutate, just like a human can walk.
  • It will also follow convention (seeing code from already implemented solutions).


  • Less separation of concern, therefore, harder unit testing.
  • Harder to extend later when different kinds of mutations need to be added.