Skip to content

Commit 628fc39

Browse files
authored
Update Singleton vs Prototype.md
1 parent f3e492b commit 628fc39

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Basics of SpringBoot/Singleton vs Prototype.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* A prototype scope means that a new instance of the bean is created each time it is requested. Each consumer gets a unique instance.
55
## Characteristics:
66

7-
## Multiple Instances: A new instance is created every time the bean is requested from the application context.
8-
## Memory Usage: Can consume more memory and resources since multiple instances may be created, especially if the bean is requested frequently.
9-
## No Shared State: Each instance is independent, so changes to one instance do not affect others. This is useful for beans that need to maintain state that is unique per request or user.
7+
* Multiple Instances: A new instance is created every time the bean is requested from the application context.
8+
* Memory Usage: Can consume more memory and resources since multiple instances may be created, especially if the bean is requested frequently.
9+
* No Shared State: Each instance is independent, so changes to one instance do not affect others. This is useful for beans that need to maintain state that is unique per request or user.
1010
## Use Cases:
1111
* Stateful Beans: Ideal for beans that need to maintain unique state for each consumer or interaction.
1212
* Transient Beans: Useful when beans are short-lived and their state should not be shared.

0 commit comments

Comments
 (0)