Last active
December 17, 2022 13:15
-
-
Save mcsee/11c5f7da7d9c54a05456102e128d010d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class car: | |
def __init__(self, company, color, engine): | |
self._company = company | |
self._color = color | |
self._engine = engine | |
def goTo(self, coordinate): | |
self.move() | |
def startEngine(self): | |
## code to start engine | |
self.engine.start() | |
def display(self): | |
print ('This is a', self._color, self.company) | |
## Displaying is accidental | |
def toJSon(self): | |
## Serializing is accidental | |
return "json" | |
def updateOnDatabase(self): | |
## Persistence is accidental | |
this.database.update(this) | |
def getId(self): | |
## identifiers are accidental | |
return id; | |
def fromRow(self, row): | |
## Persistence is accidental | |
this.database.convertFromRow(row, this); | |
def forkCar(self): | |
## Concurrency is accidental | |
ConcurrencySemaphoreSingleton.getInstance().forkCar(this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment