Hello, distance in Prius lesson, we have learned what modules are in decay?
We also created our first modular application.
In case you skipped the previous lesson, please make sure you watched it because in this lesson, we'll
keep talking about modules.
But this time will not create our module application from scratch.
But instead, we'll focus our attention on the questions of migration of Nano Modular Java application
to modular Java application.
Also, this lesson will be interesting for architects who are in charge of Java migration and responsible
for making decisions and planning next migration steps.
You need to be aware about issues and solutions that we are going to discuss in this lesson.
This is a super important topic, especially if your organization made a decision to migrate from Java
eight to NAS, a long term support version like Java Plans that includes support of modules.
And also, this is super important in case you decide to pass Oracle Java certifications, because some
of the Oracle certifications include questions about migration to modular application, including top
down and bottom up migration, and Split Ajala Agile Associates application into modules for migration.
We'll start our lesson from learning and understanding of general algorithm for migration of our court
to the new environment, including migration to the new version of Dedicate.
Special focus today will be the migration of application to modular architecture.
I will explain in one Java Class Dependency Analyzer tool is and what Java deprecated API is.
Current tool is also we're going to learn today.
Different migration strategies will review Bottom-Up and top-down migration strategies that start our
lesson.
And before I start diving in details, let's come up with steps and migration algorithm first, the
step number zero and super important one.
If you great internet, not sure that you would find this advice anywhere, but exactly as you said,
was help make them a great deal.
Worse software products two different versions and environments before any movements were scored that
potentially may impact the way our program works, no matter whether this is refactoring or migrating
and in what may impact or change code and the way how it is executed.
Make sure that you have for libel suit of tests on different levels.
The general recommendation here would be to automate as much as possible.
Some of my clients say to me that this automation is a huge investments and they have dedicated manual
regression time and cost wise, easy to understand the point you were talking about short periods of
time and a not complex project.
But I also saw projects where regression takes months.
Nowadays, probably it is crazy.
Amount of times it will add this software product to survive in the current environment, where your
competitors are releasing new features each week or two weeks and your product only has regression for
one months.
Definitely.
Is there a different areas and domains?
Some of them more competitive?
Some of them less.
But I am sure you understood my point.
So when my clients send me about not having enough resources on the creation of automation test and
framework that includes small tests, use regression tests, etc., I'm asking a simple question.
I am sure that in this case, you have enough resources and needs to halt any migrations.
Probably it is better to put resources into product development, marketing to the market, find investments
and come to the point where we have enough resources to scale and grow because otherwise we are not
doing any migration just to do migration.
We need to identify purposes of the migration and be sure that our migration brings some value and it
is needed.
And if it is needed, we're happy to accept all imports and provide everything what is necessary to
make this happen.
Here's where the first principle comes from.
We need to identify goals of our migration and measures to stay specific and objective.
What we are trying to achieve by performance, better security, better code design in order to be able
to scale application faster.
This is super important and once goal is defined.
Make measurements of the current system.
You need to have something and other.
You can say communication has been successful.
Often, migration trends are the goals were achieved because at the end of the day, we never the a
factor on migration just for fun.
We do it to get advantage of measurable benefits.
Never forget about this.
Let's agree it's within the scope of this particular demo will hold migration to another long term support
Java release in order to achieve better structure in order to simplify introducing of new features,
improving court architecture to make each release predictable and reduce impact of introducing new changes
on already released codes.
Improved security.
We are achieving better encapsulation of components, greater platform integrity, improved performance.
These are goals of Java platform Model S system and in case you missed the previous lesson.
Please watch it because we discussed goals and benefits of modules in detail in previous lesson, and
we agreed to migrate our app to the modular architecture.
Let's review the following steps for this.
The next thing that we need to do is to download the updated JDK version Java Platform Modular System
finally was introduced in Java version nine.
But as we discussed in the first lesson about JDK, I would recommend you to use long term support Java
versions.
Nowadays, we have two long term support versions.
They are eight and 11 considering that we want to migrate our app to have modular application.
Most likely, we would opt for Java version 11.
But you also can opt for Java version nine if you wish.
Wrong application was near adjudicate.
This is also important step.
Java ensures backwards compatibility, but still, there might be some changes.
For example, if you used some options for garbage collector, pay attention that, for example, indicate,
well, some of them removed.
That's why, even despite Java guarantees backwards compatibility, it is never redundant to compile
and run your app with new adjudication.
Also, this might be important to ensure compatibility was a by your libraries.
So the main goal is to run your app on the use adjudicate mission and to deal with this task.
You need to be aware about new features in Japanese that you want to use for immigration.
This can be easily found on the official websites.
The first step would be to update third party dependencies if needed.
So we need to make sure that your app was all external dependencies may be compiled, built and started
successfully Ranji DApps against your project.
Enthusiasm for familiar with J.
DApps and don't know what it is.
Let me quickly explain.
Basically, this is a tool that is present in JDK to identify dependencies between classes, modules,
packages in your app.
It is a common line to runs a Java Class Dependency Analyzer tool.
It processes Java bytecode, meaning the class files all the jars that contains them and analyzes the
statically declared dependencies between the classes.
The results can be filtered in various ways and can be aggregated to package or jar level.
Knapp's is also fully aware of the module system.
This is super important and useful for you to understand before you plan and immigration, and before
you make any final decision about your modules and packages structured a little bit later.
In this lesson, I am going to show you how to work with Jade DApps program Ramji that are scrum against
your project.
If you're not familiar with this, though, let me quickly explain what it is.
This tool is a static analysis tools its concept jar file or some other aggregation of class files for
usages of deprecated API elements.
When you upgrade to the new version, you might be interested in this information to to update your
code accordingly.
Do not accumulate dependencies on deprecated classes and masses a little bit later today on the real
example, I'm going to show you how to apply this to now.
After all these steps, we're safe to proceed with the next steps on this stage.
Having all necessary input information, we are ready to make a decision and plan the duration we need
to select the migration strategy.
Today, we'll discuss a few of them.
Once you select migration strategy and plan migration steps, we're going to proceed with migration
execution.
Usually, Oracle and community release migration guides for each new version that contains important
information that you need to consider during the migration of your app.
One of such goods, I will leave in attachments to the lesson.
But you can easily find similar guides for other versions, and each migration should be followed by
regression testing.
We already discussed that even before starting doing steps like this, we need to make sure that we
have reliable sort of tests that will allow us to confirm that at least nothing is broken and migration
goals are achieved.
After that, we are ready to proceed with a step where you can apply measurements that you did before
migration to verify region of migration goals.
For example, if the goal was to improve performance, measure performance of your app after migration
and if performance become even worse.
The question is was immigration was successful?
I don't think so.
That means is that some steps still need to be done and planned.
This migration should be adjusted to include additional steps to reach the goal of migration.
Does it make sense?
So now, like the reviews it, I'll Google one more time.
Press pause if needed.
And once you are sure about each step and the sequence of actions we are glad to proceed is a step number
zero.
I have separate course for that.
You can check my course got and test during development.
I elaborated a lot on this topic.
Step number one is up to you and your organization.
You should identify goals of migration internally, and I wouldn't be able to help you with that.
Do not forget to perform any measurements.
How long was a goal to compare these before immigration and after migration?
Regarding the loading of the latest duplicate version, I believe if you already watching this lesson,
you are smart and mature enough to download Oracle JDK or open JDK.
After that, you need to run your project with new JDK.
I'm sure you will be able to those that want the same as updates and third party dependencies too,
and with the next step, probably let me help you with that one.
Let me explain to you more about the app's program, how to use it and show this on live demo.
So as we have discussed, GDP is a Java dependency analysis tool, probably the first questions that
students ask me is where they can get the depth and the words they should download.
I want to say that you don't need to worry about that if you have dedicated, download it on your PC.
This program is already is.
They're waiting for you in bin folder since Java version eight will work with this tool directly from
Command Prompt.
So make sure that you JDK pass configure it properly and that Jane Daps Version Command returns your
result in command line.
Let me show you a quick them in order you could understand how to work with this still.
This told me on the last group of classes.
Let me show you two examples now in the first example, I will show you how to analyze old fashioned
clean Java project as a simple project we are going to use.
My Java project was examples, the ones that are used to demonstrate different topics to students of
mine.
And then the second example will analyze more single modular project that doesn't have too much dependencies
between different packages and modules in case you have a general project.
The first thing that you need to do is to aggregate all components resources in one folder miserably
Jr. Archive in separate lessons were learned such build tools and maven granule, et cetera, that those
in charge of building your project, creating some deployable pieces like jars or walls, and now a
specific case would need to generate just by our cells in the clips.
I can easily do this by mouse, right click on the project, find them experts option and select the
jar.
File some options here.
Now we need to specify jar pots and place where archive will be located and generated zen numerous of
other options.
Majority of them are so describing I want a stop on those.
But even in case you have some questions, let me know in comments below this video and I will be happy
to answer.
Now one, we have jar file.
We are ready to analyze it.
I open it bush terminal in this folder and now executes my script in this directory.
Commands that I'm going to execute is stored in a common dirt file.
I store the script on the Zagat index so that you could investigate it later.
Let me open this script and I will explain what is the reason here.
This is actually to invoke Java dependency analysis.
That output is a command line option to specify a destination directory for the file output, not file
content is simple tags that can be copied and pasted into the online editor, for example, or other
editors to generate graphs that visualizes dependencies will generate one in the middle.
You can see that they use Dot after dot output option.
If you are familiar with this character, then you already know that Daughtery first is a current directory.
So this means is a dirt file will be generated in the current directory, whereas this command will
be executed.
The next option is recursive.
This option recursive the traverses or runtime dependencies plus force option specifies directory was
ClassPass, including external dependencies in our particular cases, with few external dependencies
on different lessons.
And I don't know that these jurors into my downloads folder.
That's why I also included those here, and the last program argument is just to analyze.
Basically, that is the ones that we built.
It contains all classes from all packages of my training project that's executed the script.
I wrote the name of the script to console and press enter.
It takes some time to analyze dependencies, but finally, not file is generated in the current directory.
Let's open it, and you can see that the content of this file is just text.
It contains some specific structure.
You can see dependency of each package on another package, probably when you have session load of packages.
It is even better to use this text representation to analyze this data and think about structuring new
modules.
But still, if you want to visualize it, let's use special tools for that.
We can find online tools to visualize our dependencies.
For example, we can use just one of those I'm talking about.
Map Graph is just Scorpion's based content of the file based here and press generate graphs button.
That was easy, but you can see how much gross dependencies we are.
Definitely.
There is a lot of work here, considering this is a project and a lot of different topics.
Some of them very often reuses some common glosses or packages, and that's why we have something like
this.
You can spend time after the lesson and used to get this.
I added these files in to get this.
So you will be able to find those in the directory of the project.
Most likely, if you would, any great all project that doesn't have more destruction, you would see
something like this.
Or even worse.
Well, most likely you will see worse.
Sorry, but this is true.
OK, let's move on, and now I'd like to show you how to work with this, though, if you would like
to analyze modular application.
And you remember, is it a previous lesson of the creative modular application?
Let's analyze dependencies for that app.
The idea is similar, but instead of Java, you can pass a reference to the director with your modules
so you already can make a conclusion.
ZG Depths Program has separate group of command line options for modular and non modular applications.
These are common ones that they want to execute is also stored in shell script.
Let me open the file and we'll discuss what is written here.
Also to execute shell script in the other directory, I open terminal.
As you can see, I use Module First Command Line option and pauses a reference to the directory where
all my module is located.
Another option is that modules to add modules to zero set for analysis.
I use custom to add all modules in the directory as the last option here is the list is pretty familiar
to you.
This is for the output.
Let's execute this script in the terminal and we have generated summary file.
Let's copy content from here and let me paste this content on the website to generate the graph.
As you can see, code I think moves at depends on coal.
I think moves greetings module and Moses and the pass on Java based module.
Is it clear for you?
Press a pause for a minute and sync one more time about this live demo.
Thank you.
Samsung is still not clear for you.
Please do not hesitate to pose your question below this video, and I will be happy to answer.
On the screen, you can find common long options that you may use with great depths on the slide, you
can find possible options.
Module dependency analysis options.
Options to filter dependencies.
Options to filter closest to be analyzed.
And as you can see, there are a lot of them.
Probably it doesn't make any sense to me holding them off each option.
I believe you understood the main principle, and so I would demo was few options.
You can just play with other options if you want.
Feel free to pause the Ouija if you want to read all comments on the slide.
OK, let's proceed.
The next thing that I am going to demo you is depressed, can't program, you have a deprecated API
kind of tool is a common line tool to scan for users.
So deprecated API elements of given Java class files.
Input glosses can be given as a bosnich to a class file and directory or jar file, the same as G Deps
G Deeper Scan also has been included in genica installation since adjudicate.
That means you can find that in bin folder of Dedicate.
And if you configure Java POS properly, you can access it from command line.
I'm going to show you example, Wisconsin, of my learning project, I put Judy Proskauer in Shell script.
The simplest way how to use this command is to invoke it and pass journal names that we would like to
scan.
I want to execute this script and get the bus.
And again, it takes some time because Project has a lot of files and it is done on the top.
You can see notifications in which classes are used.
Deprecated masses Knowing this information, you can just check deprecated masses, usually in documentation
is deprecated mass that it is specified which other mass that you should use instead.
That is simple.
I agree.
And this command also has few important command line options.
Definitely Zionism's MS engine.
That program has but still something for you, at least to be aware of response if you want to explore
all these in details.
And if you're OK, I will continue.
Now, let's review immigration strategies.
We will cover case when a regional application is based on gender versions that is less than juvenile
or it is Java nine or higher, but the modular approach wasn't originally implemented since the use
of this mechanism is fully optional.
M. relearned tools and went through the step where we did the line, which modules draft files are present
in application and what dependencies exist between them.
Also, another way to do that besides such automated tools of static code analysis as DApps is through
an Iraqi eagle diagram, whereas these dependencies are represented in their way.
This will help give an overview of the components of the application and of each of them, and in which
orders it can be migrated.
Identifying those who will not be able to adopt temporally or definitively.
The later case can be given, for example, insert various libraries that have stopped offering support,
and that will hardly become modules.
There are two different migration mechanisms that responds to different initial situations.
To illustrate the process in each of them, let's imagine the next scenario we plan to migrate an application
that consists of three jars representing the different layers of the application.
They are application services and utilize the diagrams that you can see on the screen.
Now shows the dependencies between these lists.
Where application depends on services and the tiers and services depends on the utils only.
Let's review Bottom-Up migration first.
In this strategy, initially, all jar files that are part of the application will be located at its
ClassPass.
All of them can be migrated one by one.
Does the module POS?
To do this, we need to follow describes steps.
The first thing that we need to do is to choose a project package or layer was the lowest position in
dependencies.
Iraqi yet has not yet been migrated to module.
That means to select the project that has less dependencies.
In our case, this is your deals there.
After that and the module info Java file to the project, it will be needed to.
Ads are quite explicit statements to make current module packages available to Iraqi Higher Level Modules
Moves Integrated Project as a named module from application's class bus to its module bus ensure that
all not yet migrated.
The modules remain as unnamed modules in application's class bus.
What is unnamed modules were discussed in previous lesson.
One of the learned modules types please refer to the previous lesson through use that, if needed after
we did all this is this seems it remains to do is to repeat this process was the next lowest level packages
list of projects in the Iraqi.
That is not migrated yet, and we are progressing in the bottom direction.
Can you understand now why this strategy is called bottom up when this approach works the best and when
we need to apply?
The bottom up migration strategy was the best one.
We have the ability to modify any jar that has not yet been converted to module.
It makes easier as a migration of the project's packages was a whole layers that are at the top of the
dependency diagram and encourages care in what is exposed to other modules.
The modules of the lower levels of the Iraqi will be found in the module costs without access to the
packages of unnamed modules.
While these unnamed modules that have not been migrated and allocated in the class, ClassPass will
be able to access zip packages located in both class and module bus.
Does it make sense so far?
And now is immigration strategy would be top down in this strategy, initially, all jar files that
are part of the application will be located at its model bus, so all non-immigrant its projects are
treated as automatic modules.
Greatest lesson I current or what automatic modules are.
So please make sure you watch the previous lesson about modules.
If you forget, this is example when I didn't use modular approach since it is optional in this case,
it is recommended to frozen next steps.
The first thing to do is to choose a high level project and the dependencies Iraqi that has not yet
been integrated the module.
After that, we need to add some module info gel file to the project to transform it from an automatic
module to a named module.
Also, we shouldn't forget to add necessary expert statements to make current module packages available
to other modules and the necessary require statements that makes available OSM modules expose packages
to the current one in case of the reference to a module not yet migrated.
It should be done through its automatic module name.
Once these have been migrated, these references should be changed to Z definitive module names.
Repeat this process was the next high level component.
Is Iraqi citizens not migrated yet?
Then the stunt in which case is top down strategy needs to be applied and robust at best.
This strategy is the best when you don't have the possibility of one day on the horizon.
All the dependencies of the application was a temporarily or definitively.
Also, the lower dependencies of the application have not yet been modularized.
The application itself can be converted into morning.
Named modules that have already been integrated will be found in the module.
Boss was access to the entire code contained in the automatic modules that are also found in module
path.
Is that clear?
And remember another important sync?
In all cases, we have to avoid circle of dependencies between modules.
That's all what I wanted to share with you in this lesson.
Let's recap what we have learned today.
After this lesson, you know, general algorithm to follow during the platform, migration to the new
environment or in US adjudicate version in particular.
I showed you how to use in practice Java Class Dependency Analyzer to also we used how to use Java deprecated
API second to review of different migration strategies, namely, we bottom up and top down migration
strategies.
I hope you'll love this lesson and learned a lot of new useful sinks.
Thanks a lot for your attention.
Have a great day and see you in the next lesson.