Tuesday 9 July 2019

Maven: Dependency Management


In real time, your project can depend on other projects. For example, you may be using junit to write unit test cases, spring-rest to provide rest services, log4j to implement logging in your application.

There are two types of dependencies.
a.   External Dependencies
b.   Internal Dependencies

External Dependency
An external dependency is a libary that can be implemented by third party.

For example, junit, spring-core, log4j are the examples of external dependencies.

Internal Dependency
Let me explain with an example. A typical web application, is broken down into below 3 modules.
         a. DAO Layer: It has direct access to the database
         b. Service Layer: It used the apis provided by DAO layer and adds extra functionality
         c. Application Layer: Application layer consumes the service layer to process user requests.
        
As you see, "Application Layer" depends on "Service layer", "Service layer" depends on "DAO layer". In this case, "Service layer", "DAO layer" are the internal dependencies to the "Application Layer" module.



Previous                                                    Next                                                    Home

No comments:

Post a Comment