You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -142,3 +144,96 @@ all the required **parameters** and returned a `DynamicModule` of `MyModule`.
142
144
143
145
For more example, checkout [Ellar Throttle Module](https://github.com/eadwinCode/ellar-throttler/blob/master/ellar_throttler/module.py){target="_blank"}
144
146
or [Ellar Cache Module](../techniques/caching.md){target="_blank"}
147
+
148
+
149
+
## **Lazy Loading Modules**
150
+
Ellar supports loading module decorated classes through a string reference using `LazyModuleImport`.
151
+
For a better application context availability usage in module like, `current_config`,
152
+
`current_app` and `current_injector`, it's advised to go with lazy module import.
153
+
154
+
For example,
155
+
we can lazy load `CarModule` from our example [here](../overview/modules.md#feature-modules){target="_blank"} into
Copy file name to clipboardExpand all lines: docs/overview/modules.md
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,8 @@ Thus, the architecture resulting from most applications will include multiple mo
16
16
Building an application as a group of feature modules bundled together helps to manage complexity, have a maintainable, extendable, and testable code base, and encourage development using SOLID principles.
17
17
18
18
A typical example of a feature module is the **car** project. The `CarModule` wraps all the services and controller that manages the `car` resource which makes it easy to maintain, extend, and testable.
Copy file name to clipboardExpand all lines: docs/overview/providers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# **Providers**
2
2
A provider is any class or object that is **injectable** as a dependency to another class when creating an instance of that class.
3
3
4
-
Providers are like services, repositories services, factories, etc., classes that manage complex tasks. These providers can be made available to a controller, a route handler, or to another provider as a dependency.
4
+
Providers are like services, repository services, factories, etc., classes that manage complex tasks. These providers can be made available to a controller, a route handler, or to another provider as a dependency.
5
5
This concept is commonly known as [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection){target="_blank"}
6
6
7
7
In Ellar, you can easily create a `provider/injectable` class by decorating that class with the `@injectable()` mark and stating the scope.
0 commit comments