THE SPRING FRAMEWORK

The most fitting definition of Spring is perhaps the one given by the authors themselves, who define it:

«an open source framework created with the aim of managing the complexity in the development of enterprise applications.»

  • This definition raises some questions in those who already know the Java world and are approaching Spring for the first time, the first of which is: “why learn this framework and prefer it to the myriad of existing and established ones?”
  • The question, which at first may appear trivial, instead offers a key to fully illustrating the advantages offered by Spring, which, although developed after many other frameworks, stands out as one of the best and most complete.
  • The answer to this question is actually not simple and can partly be summarized in the following points:

Spring is a “light” framework and thanks to its extremely modular architecture it is possible to use it in its entirety or only in part. The adoption of Spring in a project is very simple, it can happen incrementally and does not upset the existing architecture. This peculiarity also allows for easy integration with other existing frameworks, such as Struts.
Spring is a lightweight container and is proposed as an alternative/complement to J2EE. Unlike the latter, Spring offers a simpler and lighter model (especially compared to EJB) for the development of business entities. This simplicity is strengthened by the use of technologies such as Inversion of Control and Aspect Oriented which give greater depth to the framework and encourage the developer to focus on the essential application logic.
Unlike many frameworks that focus more on providing solutions to specific problems, Spring provides a complete set of tools to manage the entire complexity of a software project. We will analyze in detail the tools offered by this framework, for now it is sufficient to state that Spring provides a simplified approach to most of the recurring problems in software development (database access, dependency management, testing, etc.).
Spring is a framework born with the idea that quality code should be easily tested. This philosophy means that, with Spring, it is very easy to test the code and, thanks to this peculiarity, the framework has carved out an important space for itself in those areas where testing is considered a fundamental part of the software project.
Throughout the guide we will have the opportunity to better answer the question posed and other doubts that arise every time we approach studying a new framework.

THE SPRING FRAMEWORK

SPRING FRAMEWORK Spring framework consists of an ecosystem of software that is constantly being improved and updated by the community. This is one of the main strengths that have made Spring the most widely used framework in enterprise application development on the Java platform. The technologies you will learn in this course are as follows: SPRING MVC SPRING BOOT SPRING SECURITY SPRING DATA JPA DEVELOPMENT TOOLS The development tool we will use in the projects will be the Spring Tool Suite. There are other technologies that you will learn through the spring framework and they are: ORM Hibernate JPA [...]

By |2023-10-15T06:47:13+00:00October 15, 2023|0 Comments

SPRING FRAMEWORK COMPONENT INSTALLATION ON WINDOWS

SPRING FRAMEWORK COMPONENT INSTALLATION IN WINDOWS Before I outline the tools needed to use Spring Framework on Windows I will summarize the features of my development machine; you will see why shortly. I am working on a MacOS Sonoma 14.1 computer Apple M2 chip ARM 64 architecture. Through Parallel Desktop for Mac Standard edition I virtualized two environments, Windows 11 Professional and Ubuntu Linux 22-04 LTS. Unfortunately, SQL Server Express 2022 and Sql Server Management Studio (SSMS) are not supported on this architecture. Because of this, I will not be able to show you installations of these two components. [...]

By |2024-11-10T15:53:50+00:00October 26, 2023|0 Comments

SPRING FRAMEWORK COMPONENT INSTALLATION ON LINUX

SPRING FRAMEWORK COMPONENT INSTALLATION ON LINUX Before I walk you through the tools needed for Spring Framework on an Ubuntu 22-04 LTS machine I will summarize the features of my development machine; you will see why shortly. I am working on a MacOS Sonoma 14.1 computer Apple M2 chip ARM 64 architecture. Through Parallel Desktop 19 for Mac Standard edition I virtualized two environments, Windows 11 Professional and Ubuntu Linux 22-04 LTS. Unfortunately, on this architecture in both Ubuntu 22-04 LTS and Windows, MySQL Server and MySqlWorkbench are not supported. Therefore, I will not be able to show you [...]

By |2024-11-10T16:13:15+00:00October 29, 2023|0 Comments

SPRING FRAMEWORK INSTALLING COMPONENTS ON macOS

SPRING FRAMEWORK INSTALLING COMPONENTS ON macOS This is the machine on which I will teach the course, I actually own a MacBookPro with macOS Sonoma 14.1 installed, Apple Silicon M2 Memory 8GB chip and 512 GB SSD. Both MySQL Server and MySqlWorkbench are available on the Mac, reasoning that I will be using this DBMS. However, I will show you how it is possible to have SQL Server on Mac by leveraging a Docker container and how all server management is simplified through the use of Azure Data Studio. Let's start with the installation of the various components. JDK [...]

By |2024-11-10T16:16:57+00:00October 31, 2023|0 Comments

SPRING FRAMEWORK INTRODUCTION TO SPRING CONTEXT

INTRODUCTION TO SPRING FRAMEWORK In this article we will see what the Spring Framework is, clarify the concept of Framework, introduce the Spring Context essential element in development with this framework, and finally discuss Maven and the role it takes in Spring. The learning part will be accompanied with the development of the first, simple Maven project that will introduce us to Spring Context. DEFINITION OF FRAMEWORK We have said that Spring is an Application Framework, but what are frameworks? Let's give a definition. The big advantage of frameworks is that they [...]

By |2024-11-10T16:21:15+00:00November 1, 2023|0 Comments

SPRING FRAMEWORK INTRODUCTION TO CODE INJECTION

INTRODUCTION TO CODE INJECTION DISTINGUISH BEANS BY NAME AND PRIMARY NOTATION Before discussing Code Injection let's address other topics that are also fundamental to the Spring Framework. With the code in the previous article we saw that with a Bean everything is working. However, we have to wonder if instead of having one cliente, therefore one Bean there were two? Let's test insert another Bean let's call it cliente2 and see if Spring Context can resolve and distinguish between the two Beans. We also modify the Main class and see if everything works. I report the changes to the [...]

By |2024-11-10T16:27:29+00:00November 6, 2023|0 Comments

SPRING FRAMEWORK COMPONENT ABSTRACTION

THE ABSTRACTION OF APPLICATION COMPONENTS Abstraction is a technique based on Java's interfaces that ensures the isolation of classes from their implementation. It will be clearer when we go to implement our test design. You will see a more complex project structure than you have seen until now, normally this is the structure of Spring-based projects. CREATION OF THE CONFIG PACKAGE We create the config package with the ConfigApp class inside. We've already seen the @ComponentScan notation I'll tell you again that Spring will go looking in the notifications, service, repository packages for objects to be [...]

By |2023-11-09T19:35:09+00:00November 9, 2023|0 Comments

INTRODUCTION TO SPRING BOOT

SPRING BOOT It is time to deal with another of the fundamental frameworks that are available to us. The Spring Boot. Let's look at the main features with slides. Point two means that the applications we are going to create with this framework once we run the build will be ready to use, they will not need anything else to run. The main features of Spring Boot are three. First of all simplified dependency management, the Spring Framework as we used it had one small flaw, we had to waste time searching for [...]

By |2024-02-08T19:53:39+00:00February 8, 2024|0 Comments

INTRODUCTION TO SPRING MVC

INTRODUCTION TO WEB APPLICATIONS It is because of the Spring Framework that we can make Web Applications. Let us immediately clarify what Web Apps are with the support of some images. LET'S ANALYZE THE FIGURE ABOVE The moment we type an address into the browser, the browser itself uses the Internet as its medium and uses an HTTP protocol, or HTTPS when the data is encrypted, to send the request. In doing this it sends a specific request to a server, a computer that can fulfill requests, in this case we requested the index resource and [...]

By |2023-11-12T19:36:12+00:00November 12, 2023|0 Comments

SPRING MVC THE DOMAIN LAYER AND THE JDBC DRIVER

INTRODUCTION TO THE PERSISTENCE LAYER As you may remember, when we analyzed the layers of our web application, next to the presentation layer that handles requests and creates HTML, XML, JSON responses in response to the client, there is also the persistence layer whose purpose is to interface the DBMS to our application. The database can be either relational or NOSQL type such as MongoDB. In this course we will use SQL Server, then a relational database. The choice fell on this DBMS (there will also be the MySQL part) because Windows natively supports it, for [...]

By |2023-12-09T20:47:38+00:00November 26, 2023|0 Comments
Go to Top