📚 15 Tips to Become a Java Expert!
- 1. Study the basic concepts until you understand the whole basis of the language
- 2. Study, understand and practice, here is a loop, study, understand and practice
- 3. Study Java with a book, I said one
- 4. Learn design patterns, they have a lot to teach us
- 5. Understand generics like there's no tomorrow
- 6. Study collections, until you get to know the whole hierarchy and usage
- 7. Create your projects using java - hands-on
- 8. Go one more level in OOP, learn functional programming in Java
- 9. Learn concepts external to the language with architecture (monolithic and microservice)
- 10. Learn a Java framework/lib
- 11. Support someone who is starting
- 12. Learn Reactive Programming
- 13. Master S.O.L.I.D
- 14. Learn Unit Testing
- 15: Explore the Java programmers Github, there's always something to help you
But why Java?
Java is a language that is already consolidated in the market and has comprehensive documentation, in addition to an active community, and with significant modifications for improvements and security.
Since it has many developers one of the most used programming languages in the world.
Because we find Java in different spheres of technology and development: FrontEnd, Back-End, Mobile, Cloud.
That's why we find so many job openings, whether here in Brazil or abroad, always looking for trained professionals who truly know how to program in Java (translation know Object Orientation and Java ecosystem).
However, who arrives for the first time and looks at and thinks how to learn Java and still asks for help, some who could not learn Java (Object Orientation),
How can I become a Java expert?
Is it Complex to learn?
Will I be able to understand Java in a short time?
Where to find good books and courses to become an excellent developer in Java?
Learning Object Orientation is hard?
Well, we will always have questions regarding these and many other questions, today we will try to answer them in this article with tips that helped us to become experts in Java and will certainly help those of you who took the time to read this article.
It's time, let's go!
This tip is interesting, because we all know that, to learn any subject, we need to learn the basic concepts.
However, a lot of people end up skipping this part that is so important, remember no matter how much you know a language or already program
It is always necessary to study the concepts of the language and its reserved words.
The Study of a new programming language and as if we had to learn a new language (eg French, German, Russian).
When we are going to learn a new language, we always try to learn basic things, like grammar, pronouns and nouns and adjectives for later, and put
this part in practice, so we add this part to being able to learn more advanced things about that language, such as verb agreement, adverbs.
It follows the same principle when we want to learn a new programming language.
It won't do any good to want to learn a new framework/lib in Java, be it: Spring, Springboot or Micronaut, if we don't know the basis of Java (Object Orientation), it doesn't matter which language you want to learn follows the same principle 1. Study the basic concepts until you understand the whole basis of the language ).
Never skip steps ever, learn and how to climb a ladder each step has its value, If we skip the basic concepts, we will not understand the main scope of the language and consequently, we will not continue with the studies, or we will have more technical difficulties in the next step .
But what are the basic concepts in Java?
It involves learning: variables, data types, functions, looping structures (for, for in, while) — how and when to use each one, decision structures, local and global scopes, understanding data structure like array, list and create known algorithms.
But, where can I find materials to learn these basic Java concepts?
A great place to learn about Java from basics to advanced is the official Oracle documentation official documentation, but not always it has the best didactics.
But even with the documentation which contents to study there are many and I don't have the lists of this content, here comes a very
cool Java roadmap, it gives you, a structured model, with the content in order to study, both superficially and deeply.
But the documentation is not in my native language! There's no way not to learn!
Yes, but today we can translate the same via translate on the page itself, but there is a person who cannot learn by reading or does not enjoy reading,
but prefer to learn by video, I recommend a course, from Neso Academy. there is, but I speak Portuguese, don't you have one, in my language?
Another point that is also nice to understand, but I still don't have a good machine to run java and install online compilers for you to test some
basic concepts, one of which I like and use the most is onlinegdb, but there are other examples:
The best way for you to become an expert in something, regardless of the area of expertise or the language you are studying, the best way to become an excellent professional and practicing a lot.
How to study and practice, today in the heated job market in the development area, companies are creating ways to train and seek talent even at the beginning of their journey, with bootcamps and also as trainers, so always be studying and taking courses and bootcamps and also sign up for company programs, because inside you will already be directed to a specialist who will help you in your professional growth.
And do intensively Design Patterns: Elements of Reusable Object-Oriented Software (English Edition) , and its top 23.
The GoF Design Patterns are divided into three categories:
Creational: The design patterns that deal with the creation of an object.
Structural: Design patterns in this category deal with class structure such as Inheritance and Composition.
Behavioral: This type of design pattern provides solution for better interaction between objects, such as providing loose coupling and flexibility to easily
extend in the future.
Creational Design Patterns
There are 5 design patterns in the category of creational design patterns.
Singleton: The singleton pattern restricts the initialization of a class to ensure that only one instance of the class can be created.
Factory: The factory pattern shifts the responsibility of instantiating a class object to a Factory class.
Abstract Factory: Allows you to create a Factory for factory classes.
Builder: Creating an object step by step and a method to finally get the object instance.
Prototype: Create a new object instance from another similar instance and modify it according to our requirements.
Structural Design Patterns
There are 7 structural design patterns defined in the Gangs of Four design patterns book.
Adapter: Provides an interface between two unrelated entities so that they can work together.
Composite: Used when we have to implement a part-whole hierarchy. For example, a diagram made up of other parts like a circle, square, triangle, etc.
Proxy: Provide a placeholder or placeholder for another object to control access to it.
Flyweight: Caching and reuse of object instances, used with immutable objects. For example, string pool.
Facade: Creating wrapper interfaces over existing interfaces to help client applications.
Bridge: The bridge design pattern is used to decouple interfaces from implementation and hide implementation details from the client program.
Decorator: The decorator design pattern is used to modify the functionality of an object at runtime.
Behavioral Design Patterns
There are 11 behavioral design patterns defined in the GoF design patterns.
Template Method: used to create a template method stub and defer some of the implementation steps to subclasses.
Mediator: used to provide a centralized means of communication between different objects in a system.
Chain of Responsibility: Used to achieve loose coupling in software design, where a customer request is passed to a chain of objects to process.
Observer: useful when you are interested in the state of an object and want to be notified whenever there is any change.
Strategy: The Strategy pattern is used when we have multiple algorithms for a specific task and the client decides the actual implementation to use at runtime.
Command Command: Pattern is used to implement loose coupling in a request-response model.
State: The State design pattern is used when an object changes its behavior based on its internal state.
Visitor The Visitor pattern is used when we have to perform an operation on a group of objects of similar type.
Interpreter: Defines a grammatical representation for a language and provides an interpreter to handle that grammar.
Iterator: Used to provide a standard way to iterate through a group of objects.
Memento: The memento design pattern is used when we want to save the state of an object so that we can restore it later.
There are others, but they are creations that are not in the book, in my github examples of their use and also I looked for other patterns in java.
Some people don't like to read books, it seems totally boring to them.
But, I prefer to study by a book on my first connection with the language, but why?
I feel better, because the author carries in the book a point of view and also a direct way that facilitated his learning, you can do something that I call shadow, which would be like imitating speech in a language course, here you will have the opportunity to imitate the way of programming the author of the book, understand a point of view that may or may not be similar to yours.
Now comes the question which book to choose, this answer is again the answer I heard most in my programming times, it depends...
Yes, but currently we have excellent books and several authors who have a didactics, excellent, I could leave a list here, but I will only pay attention to two, because they bring the java language in depth and very well written, but the two are a sequence.
Core Java Volume I – Fundamentals Eleventh Edition (Cay S. Horstmann) : this book is a show, it brings all the reasons and explains, step by step, you can go to chapter 10 and 11, kkkkk, where he explains the graphical interface, but if you want to work with a desktop, it's good to go deep in them.
Core Java Volume II – Advanced Features Eleventh Edition (Cay S. Horstmann)
here as the name refers well and advanced, after exploring Volume I, you will enter the borders phase as I always refer to when, the flow of the program goes beyond its "Country" and calls something in another "Country", example communication with the Network and also a communication with the database and even a producer of an MQ queue (RabbitMQ, ActiveMQ, AWS SQS and Kafka), remembering that this type of MQ queue communication is not dealt with in any of the above books, but is currently common in microservice architectures.
But there is another very cool factor here and the basis of security, here in this book you already begin to understand how to use it.
But there is already the 12th version, yes it is, but I like the previous version, I adapted more to it.
Bearing in mind that this is the foundation and specification in java without using the frameworks that we will talk about later.
I could mention another one here, but I'll just leave one more, which can help you, but remember the title of this tip, choose one, Effective Java (English Edition) 3rd (Joshua Bloch).
If you've come this far, it's because you're finishing your training and you're close to becoming a Java Expert.
Design Patterns is very important in any language context you are specializing or working with.
In the tip #2 Study, Understand and Practice, we work on providing a basis for studies on (Design Patterns), but there are only 23 of them, and our area of activity day after day it grows.
Innovation and creation of other patterns, so I did a study cataloging some, remembering that all studies are materials taken from github, where someone started to seek understanding and grouping in one place.
I created a github on the subject, which so far has 33 and counting.
There are, but I need to know all the Design Patterns, no, just the main ones, the others just for which purpose the solution was implemented.
Why study Generics, yes, because in Object Orientation there is a concept of reuse, and when we create abstractions and interfaces, or even program to
the interface, or when we work with data structures (Collections), the basis of these concepts is to understand that something can be Generic, and can help the developer to abstract and get the most out of Object Orientation.
Remembering that understanding these principles can be applied to any Object Oriented language, not specifically or only to Java.
Generics appeared in Java 5, and brought interesting features for code reuse. Now, we can create a single class and, from that class, instantiate objects of different types, according to our choice.
Generics was born to solve a casting problem in Java, at this point in my studies in 2018, I went deep into some aspects of Java, and a book that helped me a lot was Java Language Features : With Modules, Streams, Threads, I/O, and Lambda Expressions (Kishori Sharan)
Being another book directly on this subject Java Generics and Collections
In my github there are also some examples on the subject.
The entire base of Collections in java (list, queue, stack, maps), are created based on Generics and Inheritance and Interfaces, so by mastering these subjects, it becomes simpler to understand and manipulate data using Java Collections.
But what would this hierarchy be, it starts at the interface, items at the top, and specializes until it reaches concrete classes at the base, each with its own responsibility, and inside it has data manipulation methods.
Here the tip #2 Study, Understand and Practice , becomes even more demanding, because generally we will be manipulating or transporting data and we will need this to do the same.
I consider it as if it were a train with several wagons, where we place them, and transport them, change some wagons or even remove them and at other points we add, or load other trains with the replication of wagons or just remove them from one and move to another train , the possibilities here are many.
Yes, you've come this far, congratulations, now I think you'll be able to get your hands dirty.
But don't do it randomly, come up with a project or two, three or more, be creative but set goals.
Example I want to learn Java Collections, but I don't have a database, create a repository, a class that loads several data and serves as your database and start manipulating the data in your repository, which manipulations listing, filtering, ordering , searching for a specific identifier, creating predicate to filter the data, traversing the data via (for, stream, foreach), creating lists or maps with the data, doing summation, average, minimum and maximum, by a specific filter.
example on how to create a repository to perform such actions.
The whole learning process is cool and like a journey that the coolest not only to where you want to go, but the whole journey, each step, each learning, each mistake and success, shaped your today and you are still evolving, but every step you climb transforms you.
Here we arrive at one of the steps or steps that I found most interesting.
Most programmers only work with imperative programming, which is a software programming paradigm that describes computation as actions, statements or commands that change the state (variables) of a program, others see top-down programming, and the Orientation to objects, already transforms your way of thinking, because we will always be bringing the real world to the computational one, so that inheritance and programming for interfaces, reduces the amount of code and in the same principle facilitates maintenance, and now we leave a paradigm from development to Functional Programming.
But what is Functional Programming?
Functional Programming which is a programming paradigm that treats computation as an evaluation of mathematical functions and avoids changing states or data.
Functional programming values pure functions, that is, functions that do not have side effects, that do not depend on any external information beyond their parameters. Pure functions give us the assurance that they will always respond according to their parameters.
In languages like Java we have to pay attention and always cherish this rule, using the final reserved word in variables and attributes of objects and generating new results from the expressions.
In many cases ensuring immutability in Java can be a bit of work, there are libs that make this work easier for us, such as lombok (with the @value annotation) or the immutables lib
Immutability is important again for having parallel processes, the guarantee that the state of the application data will not change can prevent many errors.
But here is not the context to explain Functional Programming, but to give you the possibility and the way to study it, below are two books that helped me a lot to understand how this paradigm works in Java:
Both are good, each has its own way of showing Functional Programming, in my github there is a project that provides examples of how to program functionally.
With the large amount of access to an application, or it receives a number of requests, or even its control cannot be synchronous,
was designed by the software architects, mechanism, to work with this amount of simultaneous accesses.
But the teams grew, the teams got bigger and also created micro services, where the functionalities were separated by projects, so the monolith that was a giant project became smaller, and when it stopped only a part fell, not affecting 100% of the system.
However, a rule of system development, every indirection increases the difficulty of understanding the application as a whole, it needs to deserve to exist, in this case every time we have borders or increase the layers more difficulties of understanding and development of the application will be generated, example to the If we create micro services, we will have a problem relating the data, as we will possibly have a database for each application.
In my github, I deal with the subject of how to implement a microservice solution, and how it starts from the monolithic to become a microservice.
Also in my Join Community presentation, presentation about how programming evolved and we got to the current level and all the problems that this model can generate.
When we talk about Java and framework, the first that comes to our mind is Spring and its arsenal of solutions, another one that is not far behind and we will also remember hibernate, base of spring data.
Frameworks are fundamental in terms of helping, solving complex problems that someone has already thought of the solution to, this point makes the developer gain speed and also working with them, the documentation and community gain would already be beneficial, we would not even need to pay attention to productivity.
There are others like Quarkus and micronault, jhisper and famous libs like lombok, mapstruct. grails, here Java surpasses itself with the possibilities that the Language provides, I could type dozens of libs and even so, there would still be excellent ones that I wouldn't be able to describe.
But in the spring universe I want to highlight some projects that are excellent, such as spring-boot, spring-security, spring-data , spring-cloud and spring-web, almost all of the projects these libs will be in the pom.xml or in the grid. But a point to study I advise maven.
In the case of maven, you must understand all its structure, because I must understand, the answer is simple, because 60% of all projects are configured with the repository manager, you must learn from proxy configuration, understand properties, inclusion of dependencies, exclusion of libraries that are inside other libs, how to check the dependency tree of a library, how the maven life cycle works, its goals and Plug-ins and how it integrates with CI (Continuos Integration) and how to configure profiles and repositories.
A book that helped me understand maven better was Introducing Maven: A Build Tool for Today's Java Developers .
Here is something that seems to sound strange, help someone who is starting if I am too, but remember that each one has already gone through a part of the journey, maybe what he is going through and finding it totally complex, you managed to understand and explain to him or her , but the opposite can also happen, and walking alone is complicated, already accompanied by support and greater.
I could also say help in open source projects, it would also help you to grow, because here we practice mutual help, if I know something and you don't, when we pass this stage we both will know something.
But if he doesn't know anything yet, as soon as the leveling happens, everything flows, and you'll have support and, most importantly, a strong colleague by your side, for new challenges.
I've always used the standard development model, but today's world doesn't force us to work reactively.
But what is Reactive Programming?
Reactive programming can be defined as a programming paradigm based on events that can be expected at different points in the code, serving as triggers for the execution of specific logics.
This magic word triggers , transforms programming into a totally decentralized process and even more so if we have 10 possibilities, we cannot define the order of this trigger, it will only happen and all 10 will be processed.
My first experience with reactive programming was in frontEnd (RxJs), then in backEnd with RxJava, and later I took projects that had asynchronous communications between services and started using the webClient.
But what a new thing, it's not like that, the basis of reactive programming and the observer pattern.
Here are some books that can help you a lot:
In Robert C. Martin's book, I joke that this book has sold more copies than any other in the world, Clean Code, but this book is old, yes, but the subjects in this book do not get old, in this book he deals with S.O.L.I.D - The 5 Principles of OOP (Object Oriented Programming).
SRP — Single Responsibility Principle
OCP — Open-Closed Principle
LSP — Liskov Substitution Principle
ISP — Interface Segregation Principle
DIP — Dependency Inversion Principle
In my github there is a complete presentation on the topic of development and where we highlight how this model can help in the development and maintenance and understanding of the code.
Remembering that if you apply the first three, the other two will already be being observed.
Some of you now, will think, but tests like this will help me learn Java, tests have a vital function as the name says, testing that an algorithm behaves as it should, with no possibility of ambiguity or even that an error occurs that it was not thought of by the programmer or analyst.
At the beginning, I always thought of myself for sometimes having demands that didn't go as they should, or that there were mistakes that I didn't understand, as I left them.
Until I fell into squads, whose quality professionals, I think, were on another level, there, yes, I became another programmer, always asking myself.
What can be improved in this code?
What would the quality professional be thinking here now?
So when I finished the demand, I did a scan and in my unit tests I tried to improve the functions, verify that they were meeting the principles of S.O.L.I.D, these issues greatly improved my life and also that of the team and the main customer satisfaction, because it had a very low error rate, and much less corrective maintenance and what was most evident, the ease of evolutionary interventions.
At that moment, yes, the team saw me as a senior, because being a senior is not about having years of experience or a huge resume, but being able to transmit your knowledge for the good of the team and your client, here comes a point where I always disagree with the seniors from 3 to 5 years old, the question is not whether he feels it, but the team and customers see this ability in him or her.
In tip 3. Study Java with a Book, I said a , to a question I raise the shadow.
When I took my higher education course, I was always criticized for doing this, they said I was copying, most of the time I had already finished my algorithms and I wanted to see if anyone thought differently than I was doing, because there are several ways to think and solve something.
So now think of a complex ecosystem like Object Orientation, there are N ways of thinking, structuring and writing simple codes, don't get alienated just in my way, that's right, I did better.
Here also comes the tip 11. Support someone who is starting , when you do something cool or are doing a Proof of Concept, upload to github, because you will be helping to who is starting, because when using this tip, he will be learning with his project on github.
Don't stock your learning tell people you know that subject, not only written in a resume but evidenced by a project and most importantly github will show you your evolution, I always tell my students github not and for others they see what you know when hiring you, but a timeline of your
learning process so you can understand your evolution.
One of the big considerations I always hear is that many consider Java complicated to learn compared to other languages that are more beginner friendly in a language example Python.
However, when you go deep, in the base of the Java language this problem starts to not exist anymore, another point that I understood with time and that the majority, never had difficulty with logic or development, their problems were mastering Object Orientation.
Highlighting this problem, so over time, all my Java courses, with my students, were focused on Object Orientation, and the goal was to master the 4 pillars of OOP, and over time we saw an evolution in the number of developers who changed of ideas on the subject, and many today dominate and work with Java or even put their knowledge about OOP in other languages such as Typescript and PHP.
Another point to note is that the great blockbusters of current technology, such as:
Netflix, Nasa World Wind, Minecraft, Spotify and IBM among others use Java in their systems.
The development market is growing fast and there is a lack of qualified people to take on these jobs, in addition to salaries that are very attractive.
My opinion of someone who has been in the market for a long time, study, dedicate and be patient, your determination added to your skills will soon be seen and you will be in big companies, working with wonderful teams and with a salary that will guarantee you an excellent quality of life and time with your family....