Skip to content

Instantly share code, notes, and snippets.

@Shawn-Armstrong
Last active August 26, 2023 06:28
Show Gist options
  • Save Shawn-Armstrong/6ef88420ff367a49cc28768338bb2e68 to your computer and use it in GitHub Desktop.
Save Shawn-Armstrong/6ef88420ff367a49cc28768338bb2e68 to your computer and use it in GitHub Desktop.
graph RL
  database("Database") <-."network"..-> DAO_Implementation
  DAO_Implementation <--> DAOinterface("DAO Interface") 
  DAOinterface <--> service("Servive / service interface") 
  service <--> controller("Controller")
  controller <-."network"..-> client("Client")
  subgraph DAO_Implementation
    dataSource
    entityManager("Entity Manager")
    EntityPOJO
end
Loading

Spring-Based Web Application Structure

  1. Database:

    • Represents a Database Management System (DBMS) where the schema is typically defined using SQL.
  2. Data Source:

    • Provides configuration details about the database connection, such as URL, username, password, and connection pool configurations.
    • In Spring, the DataSource symbolizes the connection pool.
  3. Entity Manager:

    • A module within the Java Spring framework that manages database operations.
    • Uses the data source to establish a connection to the database.
  4. Entity POJO:

    • A Plain Old Java Object (POJO) with Java Spring entity annotations for object-to-relation mapping.
    • Helps the Entity Manager convert between Java objects and database records.
  5. DAO (Data Access Object):

    • Provides an abstraction for database operations.
    • Typically an implementation of the DAO Interface.
  6. DAO Interface:

    • Outlines abstract operations for the DAO.
    • In frameworks like Spring Data JPA, some implementations are automatically generated.
  7. Service:

    • An abstraction layer over database functionality.
    • Provides a high-level API for interactions, keeping business logic distinct from data access logic.
  8. Controller:

    • Manages incoming HTTP requests in the Spring framework.
    • Invokes appropriate services and returns HTTP responses, often as JSON or rendered HTML views.
  9. Client:

    • Represents the end user or system interacting with the web application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment