Today, Spring Framework is used as an umbrella term for Spring projects and the Spring ecosystem, However, Spring Framework is basically a Dependency Injection Framework and we can use its Dependency Injection capabilities in any Java project, without using Spring Boot or any other Spring project.

Example Java Project

Let’s say we have a Java project with an EmployeeService that has a dependency on DepartmentService and an Application class to run the application:

package com.thebackendguy.com.service;

public class DepartmentService {

public String getDepartmentName(String employeeId) {
System.out.println(this + ": getDepartmentName");
return "Accounts";
}
}

package com.thebackendguy.com.service; public class EmployeeService { private final DepartmentService departmentService…

Image by b1-foto from Pixabay

Classes are the basic unit of a program in Java. Packages are used to manage classes and modules are used to manage packages.

Modules were introduced in Java 9. Before that, an application consists of packages that hold classes. It is a problem in large codebases. A public class means that anyone from anywhere could access that class, which can lead to unwanted dependencies. Modules are uniquely named, reusable groups of related packages as well as resources.

A Module controls which packages should be private for internal use only and which should be public for other modules to use. In…


This article will explain Java 8 functional programming related concepts, i.e Lambda expressions, Functional interfaces, etc.

Let’s start with function: A function takes an input, generates an output.

int sum(int num1, int num2) {
return num1 + num2;
}

Java supports functions since the start. A pure function doesn’t mutate the state and always produce the same output for the same input.

In functional programming, functions can be passed to other functions as arguments and can be returned from a function too. …


I have been using Netty for quite some time now. Although, once you understand it, it is pretty easy and straight forward, but starting out with Netty is somewhat confusing. The goal for this article is to share some basic concepts around Netty in the most simple way and demo a simple TCP server.

What is Netty?

In simple terms, Netty is a Framework for writing network applications in Java. Netty is neither a server like Tomcat, nor a client. Instead it provides a Framework to write either server or client.

When to use Netty?

If your application require network programming, for example you need to implement…

Muhammad Asher Toqeer

Software engineer | Writer | Author of TheBackendGuy.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store