Bersama Java Spring membangun negeri (Backend)

Overview

Hal - hal yang ada pada Java Spring

  • Application Context

    Menggunakan IoC (Inversion of Control) / Container.

  • Singleton :

    Object yang hanya dibuat 1 kali saja, jika membuat object baru akan mengembalikan object sama lagi.

  • Bean :

    Saat masuk ke dalam IoC disebut Bean, secara default Bean adalah singleton dan Bean otomatis akan dibuat dan dipanggil di IoC.

    Dalam membuat Bean harus terdapat anotasi @Configuration

    • Duplicate Bean:

      Bean bisa menggunakan tipe data yang sama, jika sama harus membuat nama Bean yang berbeda dan untuk mengaksesnya harus menggunakan nama Bean yang telah dibuat.

    • Primary Bean :

      Bean yang hanya bisa dipilih menjadi paling utama untuk mengaksesnya, secara otomatis saat dipanggil maka primary bean-nya akan terpilih.

    • Mengubah nama Bean :

      Secara default nama Bean menggunakan nama method, pada dasarnya Bean adalah unik dan tidak boleh sama, maka dari itu mengubah Bean berguna jika terjadi bentrok antar Bean yang sama. Mengubah nama Bean dengan menambah method value di dalam anotasi @Bean().

  • Dependency Injection :

    DI adalah konsep membuat obyek secara otomatis yang bergantung pada obyek lainnya atau disebut dependencies, otomatis DI akan masuk (inject) ke dalam obyek yang dibutuhkan. Konsepnya sama dengan IoC Tanpa DI akan sulit untuk membuat relasi antar dependencies.

    • Spring DI :

      Spring sejak awal menggunakan DI Membuat method untuk Bean bisa menggunakan parameter
      Secara otomatis Spring akan mencari bean sesuai dengan tipe parameter tersebut Terjadi error jika tidak ada Bean yang cocok dan terdapat lebih dari 1 Bean kecuali terdapat Primary Bean

    • Pemilihan DI :

      Saat terdapat Duplicate Bean dengan tipe data sama, Spring memilih Bean yang memiliki Primary Bean Digunakan untuk memilih Bean secara manual Dengan menggunakan anotasi @Qualifier(value="namaBean") pada parameter methodnya

    • Circular Dependencies :

      Harus berhati-hati terhadap Circular Dependencies

      Jika bean A bergantung pada B, bean B bergantung pada C dan ternyata C bergantung pada A, maka otomatis Spring akan mendeteksi error

      Jangan pernah membuat Circular Dependecies selamanya jangan

Sumber belajar

Youtube here

TODO

  • IoC / Container
  • Application Context
  • Singleton
  • Bean
  • Duplicate Bean
  • Primary Bean
  • Mengubah Nama Bean
  • Dependency Injection
  • Memilih Dependency
  • Circular Dependencies
  • Depends On
  • Lazy Bean
  • Scope
  • Membuat Scope
  • Life Cycle
  • Life Cycle Annotation
  • Import
  • Component Scan
  • Component
  • Constructor-based Dependency Injection
  • Setter-based Dependency Injection
  • Field-based Dependency Injection
  • Qualifier
  • Optional Dependency
  • Factory Bean
  • Inheritance
  • Bean Factory
  • Bean Post Processor
  • Ordered
  • Aware
  • Bean Factory Post Processor
  • Event Listener
  • Event Listener Annotation
  • Spring Boot Application
  • Startup Failure
  • Banner
  • Customizing Spring Application
  • Spring Application Event
  • Command Line Runner
  • Application Runner
  • Spring Boot Plugin
You might also like...

一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

友情提示:因为提供了 50000+ 行示例代码,所以艿艿默认注释了所有 Maven Module。 胖友可以根据自己的需要,修改 pom.xml 即可。 一个涵盖六个主流技术栈的正经仓库: 《Spring Boot 专栏》 《Spring Cloud Alibaba 专栏》 《Spring Clou

Dec 31, 2022

参考 DDD/Clean Architecture 设计理念,整合 Spring Boot/Spring Security/Mybatis Plus/Vavr 的 Spring Realworld 应用案例

参考 DDD/Clean Architecture 设计理念,整合 Spring Boot/Spring Security/Mybatis Plus/Vavr 的 Spring Realworld 应用案例

Demo · 更多项目 · 参考资料 ms-spring-ddd-examples Unified Domain-driven Layered Architecture for MicroService Apps,试图探索一套切实可行的应用架构规范,可以复制、可以理解、可以落地、可以控制复杂性的指导

Sep 23, 2022

Spring Kurulumundan Başlayarak, Spring IOC ve Dependency Injection, Hibernate, Maven ve Spring Boot Konularına Giriş Yapıyoruz.

Spring Kurulumundan Başlayarak, Spring IOC ve Dependency Injection, Hibernate, Maven ve Spring Boot Konularına Giriş Yapıyoruz.

Spring Tutorial for Beginners File Directory Apache Tomcat Apache Tomcat - Eclipse Bağlantısı Spring Paketlerinin İndirilmesi ve Projeye Entegrasyonu

Apr 11, 2022

Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

Dec 20, 2022

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot Login and Registration example with MongoDB Build a Spring Boot Auth with HttpOnly Cookie, JWT, Spring Security and Spring Data MongoDB. Y

Dec 30, 2022

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login example with Spring Security, MySQL and JWT Appropriate Flow for User Login and Registration with JWT Spring Boot Rest Api Architect

Jan 5, 2023

Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

spring-microservice Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker. Arc

Sep 13, 2022

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Jan 26, 2022

Spring REST service built with Spring initializr and Spring Data.

Spring REST Service Generated with start.spring.io, using Spring Data. Documented using Spring REST Docs. Spring Initializr - Generate new Spring Rest

Jan 28, 2022
Owner
Pradana
A full-stuck developer
Pradana
Spring Boot microservices app with Spring Cloud, Robust and resilient backend managing e-Commerce app

e-Commerce-boot μServices Important Note: This project's new milestone is to move The whole system to work on Kubernetes, so stay tuned. Introduction

Selim Horri 65 Dec 23, 2022
该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

Spring Boot Projects 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前

十三 4.5k Dec 30, 2022
Repository with Backend code for InnoTutor project. It is written on Java/Spring.

Backend ᅠ ᅠ Developers: Daniil Livitn, Roman Soldatov Contents Requirements API Database Google credentials Hosting and CI How to install locally Code

InnoTutor 20 Sep 17, 2022
Spring MVC backend written in Java for my wiki/blog

blog-api Spring MVC backend written in Java for my wiki/blog. Why Spring? Spring MVC and other parts of the Spring framework are still immensely popul

null 0 Mar 16, 2022
İnnova-Patika Java Spring Bootcamp - > Bitirme Projesi -> Backend

İnnova-Patika Java Spring Bootcamp - > Bitirme Projesi -> Backend

Murat Ali KIŞTAN 6 May 1, 2022
Application for creating blog posts, developed with Java using Spring Framework for backend and Angular along with PrimeNG Library for frontend development.

Application for creating blog posts, developed with Java using Spring Framework for backend and Angular along with PrimeNG Library for frontend development.

Áureo Carmelino 10 Nov 27, 2022
A backend for Asciidoctor used to produce Spring styled HTML

Asciidoctor Spring Backends Alternative HTML conversion for Asciidoctor with a Spring "look and feel". Maven build integration You can use the Asciido

Spring IO 40 Dec 14, 2022
In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend

In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend. We will use MySQL database to store and retrieve the data.

Ramesh Fadatare 43 Dec 22, 2022
Frontend : React , Backend : Spring boot

React(Front) + Spring Boot(Back) 작업 하기 앞서, React와 Spring Boot는 각각 다른 서버에서 돌아가기 때문에, 연동시 Front에 문제가 생기면 Back까지 문제가 생길 수 있다. 하지만, Spring Boot에서 React와 같

심재철 2 Jan 9, 2022
Spring boot backend for marble guessing game inspired by Squid Game TV series.

Back-end for marble guessing game inspired by Squid Game TV series. Built with Spring-boot and WebSocket.

Zaid 4 Sep 3, 2022