At this stage, we're now structuring this project for JDK 9.
But let's start out with a mini challenge and then we're going to discuss the project structure with
modules and finally moved aside
how we going to split the purchase into multiple modules. So the challenge here is to think about how
you split this project that was created in previous years in this course into multiple modules.
So let's say three distinct modules.
So you just need to think about the separation.
You don't have to write any code at this stage but can you break down this project into three distinct areas.
So you should be able to do that you can then write these areas which will effectively be muchall names on paper.
Now take a good look at the code, run the program again etc. and think back classes that are there and
what they used for and how they can be broken down into modules. So do the challenge, pause the video
go away and write down three distinct areas and come back and we'll talk about it,
pause the video now.
Okay, I hope you managed to figure out how you come up with three distinct names.
And it was a project so hopefully there wasn't too much of a problem for you figuring that out.
So here's where I came up with
in any event. You could see that I've spit things up into three modules and we've got common some common code.
We've got the UI for the user interface,
we've got the DB for the database. So you can see that they're the three modules and I've just prefix started
with a academy dot learn programming to make a unique module name for each.
So for me that was the breakdown with the user interface that was a distinct module.
The database curve was another module and then finally a common area which was sort of for anything
else that didn't fit in those other two areas.
Now there are other solutions,
you can actually in fact this easily separated into more modules.
But since the project is pretty simple we're running a five classes I think it's three modules at this
stage and we don't have any total packages for any of the modules.
So what we're going to do is in the next video,
we start by creating these modules.
The first thing we'll do the academy dot learn programming dot common module and I'm calling that common because containing
it does contain will contain common classes for the other two modules.
So another good name instead of a common core, classes that will be another common module will be the
album and the artist.
So you started classes if you recall to read data from the database and display it on the user interface.
So the next module of that identified was the DB module, academy dot learn programming dot DB,. Now DB of course
is data base.
So this module will have one class the data source that we use to get data from the database.
As you can see, the common module doesn't know anything about the database module.
So in other words it doesn't care how the artist or the app will be saved.
Will it be a database, xml or something else.
But the database module requires the common module to be able to convert the result from the database
to an artist or an album.
That goes is one way but not the other.
Lastly the third module that I came up with was the UI module for user interface so that the academy
dot learn programming dot UI.
Now this module requires the database module, DB module and that's because of the results from the
database are displayed on the user interface.
You know the module UI will contain the classes mind and controller as well as how after effects effects
and mail file.
Keep in mind and remember that modules can contain source code but also resources like images and in
her case, xml file. Alright, so
that's what I came up for the challenge.
But if you've come up with something similar, Congratulations.
And even if you got something that wasn't quite right, that's fine because in the next video we start
creating our first module. So see you in the next video.