Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active December 17, 2022 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/11c5f7da7d9c54a05456102e128d010d to your computer and use it in GitHub Desktop.
Save mcsee/11c5f7da7d9c54a05456102e128d010d to your computer and use it in GitHub Desktop.
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