December 2016
Intermediate to advanced
841 pages
17h
English
Let's create a new file named nyse_model.ts under the app/models directory. The NyseModel class is almost identical to the NasdaqModel class, so we will not go into too much detail:
@ModelSettings("./data/nyse.json")
class NyseModel extends Model implements IModel {
// ...
}
export { NyseModel };All we need to do is copy the contents of the nasdaq_model.ts file into the nyse_model.ts file and replace (case sensitive) nasdaq with nyse.
This kind of code duplication is known as a code smell. A code smell indicates that something is wrong and we need to refactor (improve) it. We could avoid a lot of code duplication by using Generic types. However generic types were not used here because we though that showcasing the ...
Read now
Unlock full access