课程: Learning JDBC
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
The Data Access Object (DAO) pattern
- [Narrator] One of the oldest patterns in dealing with data access is the DAO pattern. To do data access, there are several objects that you need to start with, especially in either the DAO pattern or the repository pattern. The purpose of this is to provide an abstraction between JDBC and the rest of your code. It can be just abstraction or it can be a true object. It really depends on your use case. I tend to favor the abstraction aspect, but again, that's just a personal preference. Most of the time we will use a DTO with a DAO. The DTOs are nothing more than data transfer objects that are used to store state between the layers. This is very similar to the way that we do a repository pattern. But with DAOs, sometimes people try to combine the DTO and the DAO into a single thing to be more object oriented. That is simply a matter of preference. I do prefer to keep them separate. The whole purpose of doing this is it provides a clear separation of your concerns within your code. By…
内容
-
-
-
-
(已锁定)
Using a driver7 分钟 4 秒
-
(已锁定)
The Data Access Object (DAO) pattern4 分钟 44 秒
-
(已锁定)
Understanding result sets6 分钟 38 秒
-
Reading all data5 分钟 54 秒
-
(已锁定)
Reading instance data5 分钟 7 秒
-
(已锁定)
Creating data7 分钟 10 秒
-
(已锁定)
Updating data4 分钟 14 秒
-
(已锁定)
Deleting data3 分钟 35 秒
-
(已锁定)
The Repository pattern4 分钟 32 秒
-
(已锁定)
Challenge: Implement a DAO1 分钟 12 秒
-
(已锁定)
Solution: Implement a DAO2 分钟 1 秒
-
(已锁定)
-
-