python-dependency-injector/examples/di_demo/example.py

18 lines
350 B
Python
Raw Normal View History

2016-03-29 20:17:12 +03:00
"""The Code."""
class Service:
2016-03-29 20:17:12 +03:00
"""Some "Service"."""
class Client:
2016-03-29 20:17:12 +03:00
"""Some "Client" that uses "Service"."""
def __init__(self):
"""Initialize instance."""
2016-03-29 20:17:12 +03:00
self.service = Service() # Service instance is created inside Client
if __name__ == '__main__':
2016-03-30 11:45:41 +03:00
client = Client() # Application creates Client's instance