Here is a quick diagram of how the call hierarchy vs data flow hierarchy in an n-tier architecture takes place.
- The Face in the diagram is the end user who interacts with the Presentation Layer (PL) of your product.
- The Services Layer (SL) is introduced if the Presentation Layer becomes polyglotic. If your product is a website (Using Java) like Gmail and is also available as Gmail Android App, IPhone App, then all these three applications will need to be synced with the same business logic, Database Servers right?
- Hence we need a project that uses Rest Services (WebApis), SOAP Services so that all the Apps can access the Business Logic, Databases in a language and framework agnostic way over http.
- The Business Logic (BL) consists of the product's core logic and is basically a collection of Class Library projects (producing portable executables like Dlls)
- The Data Access Layer (DAL) uses a set of technology adapters that can communicate with DBMS residing on different servers.
CALL Hierarchy (marked in red)
When the end-user clicks a button on the UI
==> A call to ==> Services Layer takes place
=>which=>calls the ==> Business Logic Layer Methods
=>which=>calls the==> Data Access Layer
==>finally calling ==> DBMS Queries / Stored Procedures / Functions / Views / Commands
DATA FLOW Hierarchy
The data is returned after the call in the reverse direction (marked in green)
Looking at the Data Flow Hierarchy, as a developer you can know which projects created in the respective layers need to be referenced and how.
The direction of adding project reference in the N-tier architecture is the same as the Data Flow Hierarchy direction.
Eg: Data flows from DAL to BL, hence DAL project will be added as a reference to BL project
Data Flow Hierarchy is used to seed your product architecture, create boiler-plate code for the product.
Hope this helps.