diff --git a/guides/v1.0/config-guide/config/depend-inj.md b/guides/v1.0/config-guide/config/depend-inj.md index bedac1d6db3..cfe8843fdd1 100644 --- a/guides/v1.0/config-guide/config/depend-inj.md +++ b/guides/v1.0/config-guide/config/depend-inj.md @@ -17,7 +17,7 @@ See one of the following sections: * Configuration overview * Class definitions * Type configurations -* Lifestyle management +* Lifecycle management * Definition compiler tool

Overview of dependency injection

@@ -57,9 +57,9 @@ Proxy : Auto-generated object that implements the same interface as the original object, but unlike this original object has only one dependency—the object manager. A proxy is used for lazy loading of optional dependencies. -Lifestyle +Lifecycle -: An object's *lifestyle* determines in what scope instances are reused, and when to release them. For more information, see the Castle project. +: An object's *lifecycle* determines in what scope instances are reused, and when to release them.

Preview of using dependency injection

This section provides examples of constructor and method injection so you can see what they look at. To use dependency injection in your module, you must configure it as discussed in Configuration overview. @@ -147,7 +147,7 @@ class Builder The object manager needs the following configurations: * Class definitions for retrieving the types and numbers of class dependencies -* Instance configurations for retrieving how the objects are instantiated and for defining their lifestyle +* Instance configurations for retrieving how the objects are instantiated and for defining their lifecycle * Abstraction-implementation mappings (that is, interface preferences) for defining what implementation is to be used upon request to an interface To define the interface preferences for the object manager, use `app/etc/di/*.xml`, `/etc//di.xml`, and `/etc/di.xml` files depending on the level. @@ -232,13 +232,13 @@ Sample argument that creates instances of `Magento\Core\Model\Session` with the Possible values -

Object with default lifestyle

+

Object with default lifecycle

<argument xsi:type="object">
 {Type_Name}</argument>
-

Object with specified lifestyle

+

Object with specified lifecycle

<argument xsi:type="object"
 shared="{shared}">{Type_Name}</argument>
- Creates an instance of Type_Name type and passed as argument. Any class name, interface name, or virtual type name can be passed as Type_Name. shared defines the lifestyle of a created instance. + Creates an instance of Type_Name type and passed as argument. Any class name, interface name, or virtual type name can be passed as Type_Name. shared defines the lifecycle of a created instance. n/a @@ -445,18 +445,18 @@ Parameters configured for a class type are automatically configured for all of i -

Lifestyle management

-An object's *lifestyle* determines in what scope instances are reused, and when to release them. For more information, see the Castle project. +

Lifecycle management

+An object's *lifecycle* determines in what scope instances are reused, and when to release them. -The object manager creates objects and manages the lifestyle of the following types of objects: +The object manager creates objects and manages the lifecycle of the following types of objects: * `singleton`—Create one class instance at the first request and subsequently reuse that instance. Release the instance when the container with which it's registered is disposed. This is the default. * `transient`—Create a new class instance every time the class is requested. -The preceding lifestyles can be configured as: +The preceding lifecycle can be configured as: -* `argument`—Defines the lifestyle for the argument only. -* `type`—A convenience configuration that defines the lifestyle for all instances of the specified type. +* `argument`—Defines the lifecycle for the argument only. +* `type`—A convenience configuration that defines the lifecycle for all instances of the specified type.

Injectables and non-injectables

We use the following terms to describe objects that can or cannot be instantiated by the object manager: @@ -469,7 +469,7 @@ Non-injectable : Object that *cannot* be instantiated by the object manager. Typically, this object: - * Has a transient lifestyle + * Has a transient lifecycle * Requires external (such as data user input or data from database) to be properly created Most models are non-injectable (for example, Magento\Catalog\Model\Product or Magento\User\Model\User).