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

18 lines
336 B
Python
Raw Normal View History

2016-03-29 20:17:12 +03:00
"""The Code."""
class Service:
"""The Service."""
2016-03-29 20:17:12 +03:00
class Client:
"""The Client that uses the Service."""
2016-03-29 20:17:12 +03:00
def __init__(self):
"""Initialize the Client."""
self.service = Service() # The Service is created by the Client
2016-03-29 20:17:12 +03:00
if __name__ == '__main__':
client = Client() # Application creates the Client