The N-Tier Architecture

A free video tutorial from Nelson Jamal
Software Engineer
Rating: 4.5 out of 5Instructor rating
14 courses
93,334 students
The N-Tier Architecture

Learn more from the full course

Spring Boot For Software Engineers

Build enterprise restful API's

06:22:25 of on-demand video • Updated July 2019

Build enterprise applications
Write great APIs with Spring MVC
Write great APIs with RestEasy / JaxRS
Use Resteasy Client API
Use Java Bean Validation API to validate properties sent from client to server
Write unit tests and mocking services
Write integration tests
Use Dependency Injection
Serialise and Deserialise java objects as JSON
Use Intellij IDEA like a real software engineer
English [Auto]
In this video. Let's go ahead and learn about the interior architecture. Often we have clients in these can be an iOS application or an Android app or even a web app written in React. So the entire architecture is divided into sections where each section is responsible to do only one and only thing. So the clients really, they are responsible to actually talk to the restful API layer. Or often people call this as the controller layer. This layer simply takes all the requests from the clients and then it does some processing now to consume data from clients. We have to use the Http methods. So perhaps you've used this in the past, but we simply have. The most common ones are get post put and delete. We're going to learn all about this in this course. So the restful API layer or the controller layer takes the request from the client and then it delegates that to the service layer. The service layer responsibility is simply to perform some business logic about the request that it has received. Now, when we build applications, we often have to, you know, store the requests from our clients or often we have to store some data about clients. For example, you know, if this was a Facebook application, perhaps we wanted to save comments, pictures and, you know, a bunch of information about a particular user. So if we want to save information, then we have the Dow layer or the data access object layer in Java. And this in fact, is a design pattern. And the Dow layer simply interacts with databases and nothing else in the databases that you can interact. It's entirely up to you. So in your layer, you can say that you want to connect to your favorite database and this could be Postgres, MySQL, MongoDB and you can even interact with a fake database. And to be honest, this is the interior architecture. Guys, finally, just let me give you the flow. So the client issues a request. So this could be a get post put or delete, and then that request goes all the way down from the restful API layer to the service layer to the Dow and finally to the database. So this is where it actually, you know, does some processing, you know, whether you want to retrieve some comments about a user or a picture about a user, you know, that would go in a database and then the database would simply give you back some response. And this response could actually be some data pictures or even it could be to say that your request was successfully acknowledged. For example, if you wanted to send an email, then perhaps you would like to, you know, get a response saying that your email was sent correctly. Then this response flows all the way back from the Dow, back to the service layer and then from the restful API, and then the user finally gets to see the data. And this is the end to your architecture guys. In this course, we're not going to focus on the client side, so we're not going to be, you know, building a React user interface or an Android application or even a swift application. So we will simply focus on understanding the restful, the service, the Dow and then the database. And this is pretty much what you would do on an enterprise application now because we're not going to be using clients in this course. We're going to use our restful client called Postman, and this guy will allow us to perform these requests as if we were using a mobile phone or a React application. And essentially we can trigger get requests, put requests, post and delete. This is all for this video, guys. If you have any questions about the N-tier architecture, please let me know and I'll be. Be more than happy to give you further explanations. Join me in the next video.