Coder Social home page Coder Social logo

spring-boot-demo's Introduction

spring-boot-demo

The content of this repository is from the Youtube Channel "Amigoscode".

https://www.youtube.com/watch?v=9SGDpanrc8U&t=535s&ab_channel=Amigoscode

Notes

In Backend part of this application, we have three layers to handle the data

  1. API Layer = StudentController class in this project. A controller is a class object to handle the data flow of the application in the MVC pattern.
  2. Service Layer = StudentService class in this project. The controller ask service to get the data or modify the data
  3. Data Access Layer = StudentRepository interface in this project

Spring Framework Overview

The content following is from the website "tutroialspoint" https://www.tutorialspoint.com/spring/spring_overview.htm

Spring is a lightweight framework for developers to create application. Spring is a modular that allows the users to choose which modules to use in their applications.

Dependency Injection(DI) or wiring

DI is the important concept for Spring Framework. In Java or system design, it is a better practice to design the classes as independent as possible. So that, the classes can be reused and tested separately. To achieve class independency and smooth classes interaction, DI is designed for that. For example, class A is dependent of class B. class B will get injected into class A by the IoC.

Inversion of Control(IoC)

Java Annotations

Java annotations are metadata (data about data) for program source code. They tells the complier additional information about our program. However, it does not affect the execution of the complied program. For example @Override annotation tells the complier that this method is override with its super class.

  • Compiler instructions - Annotations can be used for giving instructions to the compiler, detect errors or suppress warnings. The built-in annotations @Deprecated, @Override,@SuppressWarnings are used for these purposes.
  • Compile-time instructions - Compile-time instructions provided by these annotations help the software build tools to generate code, XML files and many more.
  • Runtime instructions - Some annotations can be defined to give instructions to the program at runtime. These annotations are accessed using Java Reflection.

@Transient

This annotation tells the database that the variable with this annotation does not create a column in database

Model-View-Controller (MVC) Pattern

This pattern is used to separate application's concerns.

  • Model - Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.

  • View - View represents the visualization of the data that model contains.

  • Controller - Controller acts on both model and view. It controls the data flow into model object and updates the view whenever data changes. It keeps view and model separate.This pattern is used to separate application's concerns.

Modifier: Final

final is a non-access modifier that used for classes, attributes, and methods, which makes them non-changeable (impossible to inherit or override).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.