We know how code for loading data needed for our application and this day US during the day after class 2
basically in real world this would mean that we have a database with some data. 3
Now the next step would be to write some code to fetch this data. 4
For that we need that dollar. 5
So it's the there that communicates with database and so it includes some obscure queries. 6
But since we're not dealing with D-W at this point we cannot how obscure queries but our dog classes 7
will instead use that get Admetus in their data store class. 8
So let's go ahead and write two simple doffs user doubt and bookmark. 9
And these dolls will in good methods get users and get bookmarks which will in will get users and get 10
bookmarks methods and the data stored us so let's create a package what our doffs 11
. 12
So that's the new package for dot com dot semantics they are truly are. 13
And first let's create user Dao 14
so let's add the get user methods get users matter within this dog 15
. 16
So typically this would include since it's a door it would include that as well cories. 17
But since we don't have a screen at this point so we will just invoke we'll just invoke the get users 18
method and the data store store 19
import user. 20
Now let's create a bookmark doe with get bookmarks mattered 21
and it would in invoke 22
similar method within the get in it in the store. 23
So it's got bookmarks and ingredients 24
needs to be two dimensional. 25
So that's the bookmarks dot next let's right get users and get bookmarks in our manager process and 26
they will in intern in the dormitory that we just wrote the methods that we are going to write in the 27
Manager class can be invoked from the controller. 28
So we just go there. 29
This is how MVC works where controllers really work. 30
Managers and managers in Dunwell in work doffs. 31
So let's go ahead and simply add these methods get users and get good marks in our manager process. 32
So first let's open the User Manager class. 33
From here we are going to work the door there that is their door class. 34
So let's just say I read static dolls since this is user management. 35
We need to invoke the user now. 36
So let's create an instance of this here 37
or 38
so this would simply invoke 39
got users. 40
So all it is doing is just relaying the call. 41
So that's it really does work and it's going to book manager. 42
And similarly let's instantiate a bookmark down here 43
so 44
you can go the bookmark down 45
. 46
So add credence 47
bookmark two dimensional array or this 48
and that's it. 49
So we created the Darlie are the user now under bookmark. 50
And these are the classes with which the data from our data are stored on there and done in work from 51
User Manager and bookmark manager. 52
So all on these two classes are doing is they're simply relaying the calls and they will be invoked 53
from other leaders like the controller layer. 54
And that's about it.