From the course: Building Role-Based Access using AI for Java Developers
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Implement the personal account service
From the course: Building Role-Based Access using AI for Java Developers
Implement the personal account service
- [Instructor] Now that we have our repository layer, we need to create a service layer on top of it. But what's the use case? Now consider if you want to expose all of this functionality using a RESTful APA or a GraphQL API, you would not want those implementations to know about the underlying database that you're using. But with account repository, it is clear that it is using a MongoDB, so that is too tight of a connection. Also, if you want to perform any business logic, the account repository is not the right place to do such kind of a thing. So we need another layer and that's called service layer, which hides, or which sits in between your API consumers and your repository layer. So we are going to build the service layer for accounts and we are going to do that now using AI. So I'm going to write my prompt first. Create a new class called PersonalAccountService inside service package because we want to organize our code correctly. Within this class, what we need is add…
Contents
-
-
-
-
-
(Locked)
Module overview50s
-
(Locked)
Implementing the personal account10m 47s
-
Implementing the personal account repository14m 49s
-
(Locked)
Adding custom instructions to GitHub Copilot5m 3s
-
(Locked)
Implement the personal account service8m 36s
-
(Locked)
Testing the service layer7m 51s
-
(Locked)
Visualizing the service layer consumption3m 2s
-
(Locked)
Implementing a RESTful API for personal accounts9m 45s
-
(Locked)
-
-
-
-