ghazalghorabi / TDA553-lab1

0 stars 0 forks source link

OCP: Turbo composition #10

Closed martinjonsson01 closed 1 year ago

martinjonsson01 commented 1 year ago

It might be better to put the code involving turbo into its own class which Saab95 inherits from or delegates to. Then we could create a new car with turbo without modifying or duplicating code.

https://github.com/ghazalghorabi/TDA553-lab1/blob/9064245501fc0d8910804f850959c9b46f31d00c/src/Saab95.java#L15-L21

martinjonsson01 commented 1 year ago

Jag tror att getTurbo() är överflödig nu när ni har turbofactor(), annars ser det exemplariskt ut!

https://github.com/ghazalghorabi/TDA553-lab1/blob/9a7bb11cad1ca4ae09a075ccccd54899b74953ad/src/Turbo.java#L12-L14