Loosely coupled and tightly coupled #158
-
What is loosely coupled and tightly coupled? And Springboot uses which term? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
coupling refers to the degree of interdependence between software modules or components. Tightly Coupled: Tightly coupled components are highly dependent on each other. Changes in one component often require changes in other components. This makes the system less flexible and harder to maintain or modify without affecting other parts. Loosely Coupled: Loosely coupled components have minimal dependencies between them. Each component operates independently and can be modified or replaced without affecting other components. This promotes flexibility, scalability, and easier maintenance. Springboot uses loosely coupled by using Annotation @Autowired annotation as part of its dependency injection mechanism to achieve loose coupling between components Dependency Injection (DI): Spring Boot employs dependency injection to manage object dependencies. Instead of components creating or looking up their dependencies, Spring Boot injects dependencies into components at runtime. @Autowired Annotation: The @Autowired annotation is used to automatically wire dependencies into Spring-managed beans. When a bean is marked with @Autowired, Spring Boot searches for other beans in the context that match the type of the dependency and injects them into the bean. |
Beta Was this translation helpful? Give feedback.
coupling refers to the degree of interdependence between software modules or components.
Tightly Coupled: Tightly coupled components are highly dependent on each other. Changes in one component often require changes in other components. This makes the system less flexible and harder to maintain or modify without affecting other parts.
Loosely Coupled: Loosely coupled components have minimal dependencies between them. Each component operates independently and can be modified or replaced without affecting other components. This promotes flexibility, scalability, and easier maintenance.
Springboot uses loosely coupled by using Annotation @Autowired annotation as part of its dependency inject…