geohot / corona

Reverse engineering SARS-CoV-2
2.48k stars 481 forks source link

Builder #70

Open RomanKova opened 3 years ago

RomanKova commented 3 years ago

Included Builder pattern for Genome class. This pattern simplifies the creation of the object and makes it less error prone. Objects created with Builder pattern are non modifiable and are threadsafe. Earlier the python code was using genome as a string. This could be error prone as any wrongly written code could make changes to the genome causing errors. The entites could be in inconsistent state. Builder pattern takes care of all these problems. Apart from the genomeBuilder I have also provided a generic genome builder. Which expresses the relationship between chromosomes, genes and dnscode and constructs this object appropriately as per the specification of the builder pattern