Hello, my question is: Why do we have separate layers of classes when developing a web application. For example a DAO layer, DTO layer, business services layer etc.I mean why do we follow this approach. What's the purpose of having DTO layer, if its just transfer ot data we can do it through ArrayList etc. Why a separate layer for database access, If we combine the business service layer and DAO layer functionality what are the disadvantages. I think that using these separate layer to some extent increase the work to make the application, and we should design our classes as is appropriate according to the problem at hand instead of having these three layers for every problem. Please give suggestions.

Recommended Answers

All 2 Replies

Because, by having layers using defined interfaces between them, allows you to completely change the way a specific part of the program works without affecting the others.

it also makes the entire thing more transparent and easier to maintain overall.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.