
Build a monolithic app with Maven, Vaadin, Spring Boot, and the Java Persistence API, then design microservices for vehicles and users backed by a MySQL database and Spring Security.
Install the Java development kit (JDK) version 17 from Oracle, set the PATH to include the JDK's bin folder, and verify the javac compiler from the command line.
Install Eclipse, the Java integrated development environment, by downloading the latest Eclipse IDE for enterprise Java and web development from eclipse.org and configuring with Java 17 in a workspace.
Install and configure Apache Maven to manage multi-module Java applications and dependencies. Learn to set java_home and maven_home, update path, download from Apache Maven, and verify installation with mvn.
Install MySQL on Windows using the installer, configure the server and password, create a local database administrator user, and verify the connection.
Explore how Maven resolves project development challenges by simplifying the build process, managing dependencies automatically, and standardizing builds through the pom file and project object model.
Generate a Maven project with archetype by defining group id, artifact id, and version, and convert an Eclipse project to Maven with a pom.xml.
Explore the Maven project object model (pom.xml) to define groupId, artifactId, version, plugins, and dependencies, enabling reliable builds and transitive dependency management.
Explore Maven build lifecycles and phases, focusing on the clean lifecycle to remove the target folder and recompile for an up to date application.
Explore the Maven site lifecycle, learn how pre site, site, post site, and site deploy generate project documentation, and use clean site deploy to publish html files.
Master the Maven default build lifecycle, 23 phases from validate to deploy, including process resources, package, compile, test, integration test, verify, install, and deploy.
Explore maven plugins as the plugin execution framework powering build and site generation tasks, from clean and compile to test and jar, configured via build and reporting xml.
Maven repositories include local, central, and remote; learn how Maven downloads dependencies to the local repository and uses POM and settings.xml to manage them.
Learn how Maven supports multi-module projects with a parent POM, submodules, and reactor-driven topological build order, enabling independent module development and single-command builds.
Compare parent pom and aggregator pom to understand Maven project structure and inheritance. Use parent pom to share dependencies across modules and aggregator pom to define module build order.
Explore jdbc as a standard Java api for database connectivity, drivers, the driver manager, and core components like connection, statement, and result set, along with its advantages and limitations.
Explore a concrete JDBC example against a MySQL database. Implement steps to create the database, insert data, and query records.
Map Java objects to relational database tables using the Java Persistence API, reduce database interactions, handle inheritance mismatches, and enable easy switching between providers like Hibernate.
Explore the Java Persistence API architecture, including entity manager factory, entity manager, entity, and entity transaction, and how JPA maps Java objects to tables with a vendor such as Hibernate.
Map a Java object to a MySQL database with object relational mapping and the Java Persistence API. Define entities, tables, keys, and relationships with annotations.
Create Maven project with Java 17, add MySQL and Hibernate dependencies, and implement a Student entity using JPA annotations to map to a student table with an auto increment id.
Configure persistence.xml with a named persistence unit using Hibernate as the JPA provider, connect to MySQL, and manage entities via an entity manager to persist and update records.
Explore JPA annotations to map fields to database columns, use transient and column annotations, and generate getters and setters to persist records and manage new columns.
Create and insert new records using JPA entities to illustrate basic CRUD operations. Persist person objects to the database, map columns, and verify inserts via the person table.
Learn to read a person by id using EntityManager, printing details after overriding toString. The talk highlights indexing and primary keys for fast lookups.
Learn how to delete a database item using the entity manager by locating the target entity, calling remove, and committing the transaction, all while working with Java objects via JPA.
Explore how the Java Persistence Query Language (JPQL) lets you select all entities, apply range and name filters, and return results as a list.
Discover how jpql enables platform-independent, object-based queries in java persistence, sorting data by age or name in ascending or descending order.
Learn how the entity manager executes native SQL queries alongside JPQL, including selecting from the person table with age filters and using stored procedures or RPC statements.
Attach named queries to entity clauses and reuse them, using the entity manager for typed queries like get all, get by id, and get by name.
Explore how inheritance in JPA enables mapping object-oriented hierarchies to relational databases, covering the single table, joint table, and table per class strategies for efficient code reuse.
Explore how to map inheritance in JPA using the single-table strategy, with a vehicle base class and car and bus subclasses, a discriminator column named type, and an auto-generated id.
Explore the joined table inheritance strategy in JPA, where each entity has its own table and is joined by primary keys, improving memory efficiency but increasing complexity.
Explain how the table per class inheritance strategy creates separate tables for each entity in JPA, with table-based key generation, and demonstrate persisting boss and car entities.
Demonstrate how a mapped superclass enables inheritance in JPA by sharing fields like the driving license from an abstract person to a single person table, with no separate database table.
Explore 1 to 1 relationships in Java Persistence API by modeling an employee and an address with composition, using a join column and mapped by for a foreign key reference.
Demonstrate one-to-many and many-to-one JPA mappings using university and student entities, with join column university_id and mapped by to manage a foreign key relationship.
Explore the many-to-many relationship between professors and research projects using @ManyToMany, join tables, and mappedBy in JPA. Build and persist bidirectional associations with professors and projects.
Compare eager and lazy fetch in Java persistence, showing how JPA loads data into the cache, defers loading until the getter is accessed, and remains memory friendly with lazy fetch.
Explore cascading in Java Persistence API, showing how cascade types such as persist, merge, detach, refresh, remove, and all propagate operations from parent to child in author–book and professor–project relationships.
Explore the JPA entity lifecycle events, using pre persist and post persist callbacks, and entity listeners to automatically run code during persistence.
Explore optimistic and pessimistic locking in Java Persistence API, using version attributes and database-level locks to prevent collisions during concurrent updates.
Explain the difference between the Java Persistence API and its concrete vendors like Hibernate or Eclipse Link, and how JPA delegates to the chosen implementation.
Examine the transition from Java Persistence API to Jakarta Persistence, focusing on namespace changes, the rename to Jakarta Persistence Query Language, and moving Java EE to the Eclipse Foundation.
Explore the Spring framework, from inversion of control and dependency injection to the core container, beans, and application context, showing how loose coupling, POJOs, and JPA/Hibernate enable lightweight enterprise apps.
Set up a Spring project with Maven, configure Java 17, and fetch Spring core, Spring beans, and Spring context; create beans.xml and use an application context to obtain Spring beans.
Learn how spring's inversion of control uses the container to create, wire, and manage bean lifecycles via bean factory and application context, with properties for a MySQL database.
Understand spring bean scopes, including the default singleton scope and the prototype scope. Explore web-aware scopes like request, session, and global session and their relation to the http protocol.
Explore how the Spring container manages bean lifecycle, from creation and dependency injection to init and destroy methods, and contrast singleton versus prototype scopes.
Explore dependency injection in Spring by injecting an address bean into a student bean using constructor injection, illustrating composition and bean configuration.
Learn to replace XML bean configuration with annotations for Spring dependency injection, using autowire to inject the address into the student with annotation-based configuration.
Learn to replace xml configuration with Spring annotations, define beans via @Configuration and @Bean, use autowire for dependency injection, and control bean scope with @Scope.
Use the qualifier annotation to resolve multiple beans of the same type by selecting a named bean, such as first address or second address, during autowiring.
Understand how Spring Boot, released in 2014, enables rapid, standalone, production-ready Spring apps with minimal configuration, auto-configuring libraries and supporting annotation-based setup instead of XML.
Learn to build your first Spring Boot application with Maven and an embedded Tomcat, using jar packaging. Explore Spring Boot annotations and a simple rest controller with get mapping.
Understand how Spring scopes like singleton and prototype interact, why a prototype injected into a singleton can be reused, and how an object factory provides new prototype instances.
Learn to run a Spring Boot application without Eclipse by using Maven to compile and package as a war, then start with Maven Spring Boot run on an embedded Tomcat.
Learn to build and run a Spring Boot app in Eclipse using Maven build configurations (mvn clean package and Spring Boot run), start Tomcat on port 8080 and verify index.
Explore Vaadin, an open source Java web framework that uses server-side UI components and compiles Java to JavaScript for browser rendering.
Explore spring boot and warden integration through the warden spring boot starter, configure routes with root annotations, and build a main view using vertical layouts and labels.
Explore using text and span components in a Vaadin UI with Spring Boot, enabling HTML and CSS styling, font size, and font weight via inline styles.
Define a page title for a given url and embed a button in a vertical layout; handle its click event to dynamically update the ui with new text.
Create a labeled text field, enforce min and max lengths, enable autocomplete, and use a value change listener to respond to user input before reading the value on button click.
Bind a text field to a Java object with a binder, capture the name on save via a click, and update the person object's properties through data binding.
Learn to use a text area as a multi-line input for descriptions and comments. Set label, value, height, width, and maximum length, with eager value-change mode and a listener.
Learn how to implement single and grouped checkboxes in Vaadin, set labels, enable and disable, attach value change listeners, and track selected days like Monday to Wednesday.
Configure a combo box to store strings, set items, and provide a placeholder, then attach a value change listener to print selections; demonstrate with person objects and a label generator.
Learn to display large datasets in a Vaadin grid by mapping person objects from a database to columns for name, email, and age, with customizable headers, scrolling, and alignment.
Enable sortable grid columns, apply the lumo row stripes, and manage single or multi selections to remove items and refresh the grid via the data provider.
Create a tab sheet with a main tab containing orders, payments, and services in a vertical layout, and configure orientation, enable or disable tabs, and set the default selected tab.
Explore vertical layout concepts in Vaadin: arrange components top-to-bottom, set width and height behavior, and control vertical and horizontal alignment and stretching for a responsive, fully aligned UI.
Explore how horizontal layout arranges components side by side and enables left/center/right alignment, even spacing, and vertical alignment adjustments via justify content mode and align items.
Use the form layout to build responsive forms with first name, last name, user name, and password, featuring a two-column default and a single column on small screens.
Learn to implement a Vaadin dialog pop-up with name and age text fields, a header title, and a vertical layout, including cancel and save buttons that print values on save.
Explore how to use built-in icons, place them as prefixes and suffixes in text fields, and load images from a resources/images folder with resizing options.
Learn to bind user interface components to Java objects using the Vaadin binder and bean validation, including not empty and email constraints, property IDs, and readBean/writeBean binding.
Navigate between independent views using router link to avoid reloading the page; use server-side navigation with UI navigate, define routes with root and page title annotations, and handle before enter.
Build an application using ODIN for UI components with Spring Boot and Warden, featuring a student list with name filtering, add/remove capabilities, and MySQL persistence in dark or light mode.
Create a monolithic application packaged as a single jar or war file, and configure a Spring Boot project with Maven, Java, JPA, and MySQL using Spring Initializr.
Integrate Vaadin with Spring Boot by configuring dependencies, defining a main view, and creating modular packages (constants, services, repository, models, layouts) while avoiding database setup for initial run.
Define a student and status model with getters and constructors, then build a Vaadin grid in the main view to display students by name, age, zip code, country, and status.
Create a logo layout in the views package that loads resources/static/images/logo.png, sets alt text for SEO, and centers the image in a horizontal layout; integrate it into the main view.
Customize the grid by selecting visible fields, configuring columns (country, zip code, name, age), and adding an icon-based status column with color coding for active, passive, and absorbed.
Configure the underlying MySQL database to store student objects and status objects, connect via Spring Boot using JPA and Hibernate, and enable updates with DDL auto and show SQL.
Map the student class to a database table with JPA entity, define an auto-generated primary key, column mappings, and a many to one status relationship for active, passive, and absorbed.
Configure the status entity with JPA annotations, including an auto-generated id and a name, and watch JPA create the student and status tables, preparing for the many-to-one mapping.
Define a many-to-one relationship in JPA by linking the student owning entity to a status reference via a join column, creating a status id in the student table.
Learn how monolithic applications decouple the user interface from data access using a service layer and repositories, where the service defines operations and delegates to the repository.
Understand how repository classes enable database access through the Spring IoC container. Extend JPA repositories for status and student to gain create, read, update, and delete operations via autowired instances.
Explore how status services delegate operations to repositories via the Spring service layer, using dependency injection to access the status repository and perform save, find all, and custom queries.
Define and implement the student service with save, remove, get all, and substring-based find, wired to the student repository via autowired, using JPA entities and a future G SQL query.
Load students from the MySQL database into the grid using the student service and its find all method, leveraging constructor injection and repositories that connect to the database.
Filter the grid by name using a text field with lazy value changes, loading students whose names contain the entered substring via a repository query.
Enhance the user interface by adding add and remove student buttons, then wire a click listener to navigate to a new OD student view in Vaadin.
Build a student input form with name, age, zip code, country, and status using a form layout and data binding; include a logo and save and cancel buttons.
Populate the status dropdown using the status service by retrieving all status values from the database (active, passive, absorbed). Set a default value and prepare for data binding.
Use data binding to connect the user interface components to the student class with a bean validation binder, then write values to the student object and save or reset fields.
Import Vaadin notifications, use the show method to display a 'student saved successfully' message after saving, and customize variants, duration, and top center positioning.
Learn to implement a remove student feature in a Vaadin app by navigating from the main view to a remove view with a grid of selected students and remove controls.
Continue implementing the remove student view by loading all students into a grid with multi selection and removing selected students with a success notification and navigating back on cancel.
validate student data with bean validation annotations on fields, including not null, not empty, four-digit zip code, and age range, enforced via a binder in spring boot.
organize application strings in a constants class with a private constructor and public static final values to centralize ui text, logo url, and internationalization for buttons and fields.
Learn to implement dark mode with a checkbox theme toggle and a static boolean is checked variable. Wires the toggle to JavaScript to set the document theme attribute.
Build and run a Spring Boot application with Maven using a pom.xml; execute mvn clean install and mvn spring-boot:run to access localhost:9090 and verify app features.
Understand how transactions ensure database integrity by executing multiple operations as a single unit with rollback on failure, using the transactional annotation and Spring proxies.
Apply the transactional annotation at the class level to cover all methods, optionally override specific methods, and set read only to true for reads and false for writes.
Leverage spring security authorization and authentication to keep the home page open to all users while authenticated users can add or remove students.
Distinguish authentication from authorization: authentication verifies who a user is via login credentials, while authorization grants access to specific urls and data via roles such as admin and user.
Set up authentication with spring security by adding the spring boot starter security dependency, then implement a Vaadin login view (username, password, login, sign up) in spring.
Wire the constructor-injected login view factory into a vertical layout using a static path for /login, then create and initialize user interface components and layout for the login view route.
Define a user entity with id, username, and password, mapped to a database with identity-generated primary key, implementing Spring Security's user details and a repository to find by username.
Implement a spring security service with save and logout methods, loading users by username via the security repository, hashing passwords with bcrypt, and wiring dependencies.
Extend Vaadin web security with Spring Security using configuration and enable security annotations, wire a bcrypt password encoder and user details service, and configure authentication with http and web security.
Handle login button clicks by collecting username and password, authenticating via the DAO authentication provider, storing the result in the security context, and navigating authenticated users home.
Implement logout of an authenticated user using the security service, navigate back to the login page, and inject the security service via constructor to ensure proper authentication flow.
This lecture implements a sign up form using the login view approach, introducing a sign up view and factory with username and password fields in an unauthenticated, centered vertical layout.
Implement the sign up flow by wiring the sign up and cancel actions, validating password match, saving the user via the security service, and returning to the login view.
Authorize using a role enum stored as strings in the user table and returned through the get authorities method to grant access via annotations for admin and user views.
When I started software engineering, I always wanted to code without any configurations, version control or build server configurations. Later, I realized that coding is just one part of software engineering: architectural designs, design patterns and the ability to write reusable and loosely coupled software components are much more important parts of programming.
In this course we are going to talk about the basics of professional software engineering such as how to separate the code into multiple modules or how to use a build framework to build the final application for us.
Before developing the final application from scratch - that wire all the included technologies together - we will consider these technologies on a one by one basis.
In the first section we are going to consider Maven, one of the most popular build frameworks out there. The second chapter is about Java Persistence API and database related problems. The third chapter will cover Spring as far as the XML based configuration is concerned, then we will talk about the new way: the so-called Spring Boot. Finally, we are going to implement an application in which we are going to use all the technologies we have discussed.
Section 1 - Installations
setting up the environment
installing Java, Eclipse, Maven and MySQL
Section 2 - Maven
what is Maven
build lifecycles and phases
clean, site and default
handling dependencies
POM files
Section 3 - Java Persistence API (JPA)
why to use databases?
JDBC and the old way
what is Java Persistence API (JPA)
object relation mapping with JPA
how to deal with inheritance with JPA
how to deal with composition with JPA
basic CRUD operations with EntityManager
using Hibernate
Section 4 - Spring Framework
what is inversion of control and dependency injection?
XML based configuration
annotation based configuration
Section 5 - Spring Boot
what is Spring Boot?
annotations in Spring Boot
using Vaadin with Spring Boot
Section 6 - Vaadin
what is the Vaadin framework?
creating UI components easily with Vaadin
layouts and grids
navigation and pages
Section 7 - Wiring all Together (Application from Scratch)
creating a larger application from scratch (student management software)
creating UI components with Vaadin
creating the database structure etc.
deploying and running the application
using Maven to build and run Spring applications
Section 8 - Spring Security
what is Spring Security?
authorization and authentication
login form and signup form
Section 9 - Software Architectural Principles
what is the monolith architecture?
what are web-services?
SOAP and REST web-services
HTTP protocol
the microservice architecture
Section 10 - Microservices
what are microservices?
GET, POST, PATCH and DELETE mappings
@RequestBody annotation
@RequestParam and @PathVariable annotations
customizing the HTTP request and response
Section 11 - Handling JSON (with Jackson)
JSON and Jackson introduction
ignoring properties in the JSON representation
@JsonProperty annotation
dealing with date and time
Section 12 - Handling MySQL Database
how to connect to a MySQL database?
what is JDBC and JPA?
using database related annotations
Section 13 - Validation and Exception Handling
validating beans and catching exceptions
@ExceptionHandler annotation
@ControllerAdvice annotation
Section 14 - Transactions
what is a transaction?
implementing transactions
propagation types of transactions
Section 15 - RestTemplate and API Gateway
what is an API gateway?
how to use RestTemplate to communicate between web-services?
GET, POST, PATCH and DELETE operations
Thanks for joining the course, let's get started!