python-dependency-injector/examples/ioc_di_demos/example.py
2016-04-01 10:47:09 +03:00

18 lines
358 B
Python

"""The Code."""
class Service(object):
"""Some "Service"."""
class Client(object):
"""Some "Client" that uses "Service"."""
def __init__(self):
"""Initializer."""
self.service = Service() # Service instance is created inside Client
if __name__ == '__main__':
client = Client() # Application creates Client's instance