diff --git a/examples/di_demo/di_example.py b/examples/di_demo/di_example.py index 43bb406d..75224b7b 100644 --- a/examples/di_demo/di_example.py +++ b/examples/di_demo/di_example.py @@ -8,13 +8,10 @@ class Components(catalogs.DeclarativeCatalog): """Components catalog.""" service = providers.Factory(Service) - """:type: providers.Factory -> Service""" client = providers.Factory(Client, service=service) - """:type: providers.Factory -> Client""" if __name__ == '__main__': - # Application creates Client's instance using its provider - client = Components.client() # equivalent of Client(service=Service()) + client = Components.client() # Application creates Client's instance diff --git a/examples/di_demo/example.py b/examples/di_demo/example.py index 3d498d9c..3a0d8036 100644 --- a/examples/di_demo/example.py +++ b/examples/di_demo/example.py @@ -14,5 +14,4 @@ class Client(object): if __name__ == '__main__': - # Application just creates Client's instance - client = Client() + client = Client() # Application creates Client's instance diff --git a/examples/di_demo/ioc_example.py b/examples/di_demo/ioc_example.py index 08d2fa88..26568096 100644 --- a/examples/di_demo/ioc_example.py +++ b/examples/di_demo/ioc_example.py @@ -14,8 +14,5 @@ class Client(object): if __name__ == '__main__': - # Application creates Service instance - service = Service() - - # and inject Service instance into the Client - client = Client(service) + service = Service() # Application creates Service instance + client = Client(service) # and inject Service instance into the Client