subject

Now that your tables are designed and created, it's time to start writing the code you will use to interface with them. First, let's start by reviewing the DAO - Data Access Objects - provided in the starter kit to deal with Books. We see that the BookDAO. java file is just an interface, which is implemented by the BookDAOImpl class. In the DAOUtilities class, we have a method that will instantiate and return a new instance of BookDAOImpl for us... but it returns it inside a BookDAO interface reference. Why is that?
Well, recall that an interface is capable of calling its own declared methods against a subclass reference that has those methods defined. You should also recall that just like any polymorphic reference, you can use a single superclass reference for multiple types of subclass objects. In this way, we save ourselves some time and protect our application in the face of future upgrades.
Consider a situation in which the PubHub application is undergoing another update - this time, to add a VIP tagging system. VIP users can have a separate tagging system, but their database interactions are otherwise exactly the same as a standard user. In this case, we might still use the same TagDAO interface to implement with our VipTagDAOImpl class. Then, no change is required in the code which calls the tagging database methods. We can use the same TagDAO interface reference to manipulate both a TagDAOImpl object and and VipTagDAOImpl object.
Your final task this week, is simply to chart out what kind of SQL queries your tagging system might need to run. From there, create a DAO interface which declares the methods that will call those queries. You won't need to implement them yet, that's a task for the next dive.
You will need, at minimum:.
1. A method to add a tag to a book, given the tag name and a reference to a book (either a Book reference variable or just an ISBN-13)
2. A method to remove a tag from a book, given the tag name and a reference to a book (either a Book reference variable or just an ISBN-13)
3. A method to retrieve all tags that have been added to a given book
4. A method to retrieve all books that have a given tag. Hint: This will require either a SQL JOIN statement or a nested query.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:30, jonnys412
Margins can be modified in the page layout tab or by using
Answers: 2
image
Computers and Technology, 23.06.2019 17:00, chrisgaz14
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
image
Computers and Technology, 24.06.2019 16:50, genyjoannerubiera
Ramp charts are generally created in wordlotusexcelpowerpoint
Answers: 1
image
Computers and Technology, 25.06.2019 06:20, jorgefrom584
Horseback riders, bicyclists, and skateboarders the rules of right-of-way when they use the road ?
Answers: 1
You know the right answer?
Now that your tables are designed and created, it's time to start writing the code you will use to i...

Questions in other subjects:

Konu
Chemistry, 29.04.2021 09:50
Konu
Mathematics, 29.04.2021 09:50
Konu
Mathematics, 29.04.2021 09:50