Every Java programmer must have a basic understanding of software development. So let's take a look at what is considered "basic".
1. Basic algorithms
The first thing to tackle when starting to learn programming (not just Java) is to understand the basics. For example, algorithms.
There are an infinite number of them, and you shouldn't kill entire years of your life trying to learn as many algorithms as possible: most of them won't be useful to you. You can get the necessary minimum of knowledge from the book "Grokking Algorithms". This is enough to get you started, but if you want, you can learn from the book "Structures and Algorithms" or "Algorithms in Java" by Robert Sedgewick and Kevin Wayne.
2. Java Syntax
After learning the basics of algorithms, we need to learn Java syntax. After all, you're studying to become Java programmer, right? The CodeGym course is perfect for this.
As you perform countless tasks, you will get your hands on Java syntax and then, without much hesitation, you will write/read Java code as if it were your native language.
Beyond practice, you also need to look at the theory to understand what you are doing. To do this, you can read books. For example, one of the following:
- "Head First Java",
- "Java for Dummies" by Barry Bird;
- "Java: A Beginner's Guide" by Herbert Schildt.
After reading these books, you can get down to harder books:
- "Thinking in Java," Bruce Eckel;
- "Effective Java" by Joshua Bloch;
- "Java: The Complete Reference" by Herbert Schildt.
The last three books are not easy reading for beginners, but they do provide a solid foundation in Java theory.
3. Design patterns
Design patterns are certain repeatable patterns that solve problems in frequently encountered contexts. They include basic, simple patterns that every self-respecting programmer should know. To understand this topic, grab the book "Head First Design Patterns".
It explains the basic design patterns in an accessible way. But the book talks a lot about Java, so when you consume this book you'll also need fluency in this programming language.
For a deeper dive into patterns, you can also read "Design Patterns: Elements of Reusable Object-Oriented Software" from the Gang of Four (Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides). Once you've studied this topic, you'll begin to see patterns virtually everywhere in your code.
Pay attention to this, especially to the patterns used in Spring, since this is a popular interview question.
4. Programming paradigms. Code cleanliness
Besides the standard design patterns, there are various principles and paradigms to be aware of (SOLID, GRASP).
You also need to keep your code clean and readable. For everything, you need to know about this topic, see Clean Code by Robert Martin, or check out "Code Complete" by Steve McConnell.
Our next step is to study a language for relational databases — SQL.
Databases are where the information (data) used by a web application is stored. A database consists of several tables (the address book on your phone is a simple example).
Java developers are responsible not only for the Java application, but also the database that it interacts with and where it stores its data.
In relational databases (which are the most common type), all interaction occurs through a special language called Structured Query Language, or SQL.
To understand this topic, all you need to do is read one of these books:
- "Learning SQL" by Alan Beaulieu;
- "SQL" by Chris Fehily;
- "Head First SQL" by Lynn Beighley.
But practice without theory doesn't cut it, does it? And at interviews you can expect a test of your knowledge of SQL. Interviewers often (almost always) give one or two tasks that involve writing an SQL query.
As a result, it is very important to hone your practical SQL skills to show yourself in a good light.
After learning the SQL language, you need to become familiar with a specific database implementation. Depending on the database, some commands may vary dramatically. And there are quite noticeable differences in database capabilities.
The most common relational databases are MySQL and PostgreSQL. MySQL is far simpler, but PostgreSQL has much broader capabilities. Being familiar with at least one of them is enough to get started.
You can study database implementations if you use your googling skills — find relevant articles and tutorials on YouTube. You will need to cultivate your ability to craft proper search queries for the questions you need answered. After all, a programmer is someone with a black belt in googling.
You need to learn either the Gradle or Maven framework. They are for building projects, and for you, Java is now not only for tasks involving a couple of classes, but also a language for writing full-fledged applications.
You need to understand how to build a project, what the build stages are, how to load the necessary external libraries with third-party code, and much more.
Despite the fact that Gradle is newer and more concise, Maven is used in most cases. So, pay special attention to the Maven build lifecycle.
Git is a distributed version control system. This technology lets developers collaborate on a single application without interfering with each other.
Of course, there are other version control systems. For example, Subversion. But Git is used most widely, and you need to be able to work with it. In addition to the many articles about Git you can find online, YouTube have more than enough videos to help you master this technology, step by step.
At first, it is better to use Git from the command line rather than some sort of GUI implementation, because you will be forced to do everything using commands. In interviews, people often like to ask about a few Git commands, so I recommend that you write them out and keep somewhere close by.
This technology connects your Java application and a relational database. For the basics read any JDBC tutorial.
There is an abundance of articles that explain JDBC and provide rudimentary examples, even though no one is using naked JDBC directly anymore.
10. JPA. Hibernate
JPA is a way to establish a connection between a Java application and a database, just like JDBC. But at the same time, JPA is a higher-level technology and therefore easier to use.
But JPA is only a specification, not an implementation. It needs a concrete implementation. Many of them exist, but the closest to JPA ideals, the most popular, and most developed is Hibernate.
You will come across this technology more than once in your software development career. So, in addition to becoming acquainted with this technology by reading articles, it may be worth thinking about reading a book, for example, "Java Persistence API".
When you become a Java developer, Spring is no longer just a word for you. Knowing this framework is now as important as knowing Java Syntax. You could say that Spring has a sibling, i.e. Java EE. But Java EE is outdated and no longer used on new projects.
The overwhelming majority of Java developers are now Java-Spring developers, so knowing some basic Spring technologies is a must.
Spring is not just a framework, but a whole framework of frameworks:
And this is just a subset of the frameworks that Spring provides. For a beginner, knowing only a few of them is good enough:
You should put this in the first place, so you can understand what Spring is — all about Spring containers, beans, DI, IoC, and so on. To understand the very philosophy of using Spring, so to speak. Your further study of Spring frameworks will build on top of this base. Perhaps you should create your own small application into which you can gradually incorporate all the newly learned technologies.
Earlier we mentioned JDBC as a technology for creating a database connection. In general, "naked" use of the technology can no longer be found in projects, so you may conclude that learning JDBC is not necessary. This is not quite the right attitude.
By exploring naked (direct) use of JDBC, you can see the technology at a lower level and understand its problems and shortcomings. Then when you start learning Spring JDBC, you will realize what exactly this framework improves, optimizes, and hides.
Analogous to the situation with naked JDBC, this framework leverages an existing technology, in this case, Hibernate. If you consider using Hibernate without Spring, you will definitely realize the benefits that Spring Hibernate offers.
Earlier we talked about JPA and mentioned that it is only a specification, though it has various implementations. Among these implementations, Hibernate comes closest to the ideal.
Spring has its own ideal JPA implementation that uses Hibernate under the hood. It is as close as possible to the JPA specification's ideal.
It is called Spring JPA. In a word, it greatly simplifies database access.
You can only learn JPA without learning JDBC, Hibernate, Spring JDBC, or Spring Hibernate. But if you take this approach, your knowledge of how to connect to a database will be very superficial.
This technology makes it possible to display our application's web interface to users and facilitate communication between the interface and the rest of the application. The technology can also be used without display when you have an application that is responsible for handling the display and you're interacting with the application using RESTful technology.
In order to better soak up information about Spring, in addition to articles and YouTube lectures, you can read several books. For instance, "Spring in Action" by Craig Walls. Another great book on Spring is "Spring 5 for the Professionals". It's more dense. More like a reference that is more valuable to keep close at hand than to read cover to cover.
This technology greatly simplifies the use of Spring. I didn't put it at the end of the list on a whim. Indeed, it does hide a lot under the hood, and for someone unfamiliar with the vanilla Spring, many points may be unclear or incomprehensible.
First, for a better understanding of how Spring frameworks work, you should use regular Spring, and then pick up all the higher benefits of using Spring Boot.
You should also familiarize yourself with Spring Security and Spring AOP. But unlike the technologies above, deep knowledge of these two is not needed just yet.
This technology is not for beginners. At interviews, junior devs won't be asked about them (except one superficial question, perhaps). Read an overview of what these technologies are and the princeiples behind their work.
The more you know, the faster you will find your first job.