# vshal5/nn_adv_java architecture

> Architecture diagram of the GitHub repository vshal5/nn_adv_java, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vshal5/nn_adv_java
- Repository: https://github.com/vshal5/nn_adv_java

## Overview

This repository is a set of small, mostly independent Java learning modules rather than one unified application. Each numbered folder under `CoreJava/` demonstrates a specific language or platform feature, with a simple split between `domain` classes and `main` entry points.

1. **Overall structure**
   - The repo is organized as a sequence of exercises: `01_HelloWorld` through `09_JDBC`.
   - Most modules follow the same pattern: `src/com/novonordisk/domain` for model/business classes and `src/com/novonordisk/main` for runnable demos.
   - `bin/` and `target/` are build outputs, not architectural source components.

2. **Module 01: core Java basics**
   - `01_HelloWorld` contains introductory classes such as `Account`, `Addition`, `Circle`, `Employee`, `LoginDetails`, and `NumberUtil`.
   - The corresponding `main` classes are separate demo entry points, each exercising one domain class or concept.
   - This module is a collection of isolated examples rather than a single flow.

3. **Module 02: simple banking and control flow**
   - `02_BankingApplication` centers on a basic `Account` domain class.
   - The main package also includes control-flow demos like `Array`, `WhileLoopMain`, `MultiplicationTable`, and `oddsTillHundrend`.
   - Architecturally, this module mixes a small domain model with standalone algorithm/loop exercises.

4. **Module 03: inheritance and polymorphism**
   - `03_Inheritance` models document formats with `DocumentFormat` as the base type and `PDF`, `XLS`, and `CSV` as specialized variants.
   - `DocumentFormatMain` and `DocumentFormatPolymorphism` are the runtime drivers.
   - The important boundary here is the inheritance hierarchy: one abstract/general concept, multiple concrete document implementations.

5. **Module 04: abstract class usage**
   - `04_Abstract` contains a `Shape` abstraction.
   - `ShapeMain` likely demonstrates instantiation via concrete subclasses or abstract behavior.
   - This module is focused on the distinction between abstract type and executable demo code.

6. **Module 05: interfaces**
   - `05_Interface` contains interface definitions such as `Display` and `Greet`, plus classes `MyClass` and `User`.
   - The main architectural boundary is contract vs implementation: behavior is defined through interfaces and consumed by classes that implement them.
   - This is a pure OO design exercise with no external dependencies.

7. **Module 06: exception handling**
   - `06_Exception` contains `Calculations`, which is the core class for exception-related logic.
   - `CalculationsMain` is the driver that exercises error conditions and handling behavior.
   - The subsystem boundary is between normal calculation logic and exceptional control flow.

8. **Module 07: file I/O**
   - `07_FileIO` contains file-oriented demos: `ReadFileMain`, `FileMetadataMain`, and `MyClassMain`.
   - The presence of the top-level `FileIO/User.txt` file indicates a concrete input artifact used by the file-reading examples.
   - This is the first module with an explicit external resource boundary: local filesystem input.

9. **Module 08: collections**
   - `08_Collections` introduces `Employee` in the domain package and `CollectionsMain` as the driver, plus a separate `EmployeeMain`.
   - The architecture here is about in-memory data structures and operations over collections of domain objects.
   - It stays within process memory; no file or database boundary is visible here.

10. **Module 09: JDBC persistence**
    - `09_JDBC` is the only Maven-based module (`pom.xml`) and uses the standard `src/main/java` layout.
    - It contains `EmployeeCRUD`, which implies database create/read/update/delete operations, and `EmployeeCRUDMain` as the entry point.
    - This module introduces the persistence boundary to an external relational database via JDBC.

11. **Data flow pattern across the repo**
    - In most modules, flow is simple: `main` class instantiates or calls into a `domain` class, then prints results or demonstrates behavior.
    - The main exceptions to “in-memory only” are:
      - `07_FileIO`, which reads from the local filesystem.
      - `09_JDBC`, which talks to a database through JDBC.

12. **Engineering takeaway for an architecture diagram**
    - Draw this repo as a set of separate training/example applications, not as one layered system.
    - Show a repeated internal pattern for most modules: entry point -> domain logic -> console output.
    - Add two external dependencies only where needed: filesystem for File I/O and database for JDBC.
    - The dominant technology is plain Java SE, with Maven appearing only in the JDBC module.

Main entry points: [`CoreJava/01_HelloWorld/src/com/novonordisk/main`](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld/src/com/novonordisk/main) (Demo mains), [`CoreJava/02_BankingApplication/src/com/novonordisk/main`](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication/src/com/novonordisk/main) (Loop demos), [`CoreJava/08_Collections/src/com/novonordisk/main`](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/08_Collections/src/com/novonordisk/main) (Collection mains), [`CoreJava/03_Inheritance/src/com/novonordisk/main`](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance/src/com/novonordisk/main) (Polymorphism mains)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basics["Core Java basics"]
  node_m01["01 HelloWorld"]
  node_m01_domain["Basics classes<br/>domain package"]
  node_m01_main["Demo mains<br/>entrypoints"]
  node_m02["02 Banking"]
  node_m02_domain["Account model<br/>domain package"]
  node_m02_main["Loop demos<br/>entrypoints"]
  node_m08["08 Collections"]
  node_m08_domain["Employee<br/>domain class<br/>[Employee.java]"]
  node_m08_main["Collection mains<br/>entrypoints"]
end

subgraph group_oop["OOP patterns"]
  node_m03["03 Inheritance"]
  node_m03_domain["Doc hierarchy"]
  node_m03_main["Polymorphism mains<br/>entrypoints"]
  node_m04["04 Abstract"]
  node_m04_domain["Shape<br/>abstract type<br/>[Shape.java]"]
  node_m04_main["Shape main<br/>entrypoint<br/>[ShapeMain.java]"]
  node_m05["05 Interface"]
  node_m05_domain["Contracts<br/>interfaces"]
  node_m06["06 Exception"]
  node_m06_domain["Calculations<br/>logic class<br/>[Calculations.java]"]
  node_m06_main["Exception main<br/>entrypoint"]
end

subgraph group_io["IO"]
  node_m07["07 FileIO"]
  node_m07_main["File mains<br/>entrypoints"]
  node_file_user["User.txt<br/>filesystem input<br/>[User.txt]"]
  node_console(("Console<br/>output"))
end

subgraph group_persistence["Persistence"]
  node_m09["09 JDBC"]
  node_m09_domain["CRUD logic<br/>data access<br/>[EmployeeCRUD.java]"]
  node_m09_main["CRUD main<br/>entrypoint"]
  node_database[("Database<br/>external db")]
end

node_m01 -->|"contains"| node_m01_domain
node_m01 -->|"runs via"| node_m01_main
node_m01_main -->|"uses"| node_m01_domain
node_m01_main -->|"prints"| node_console
node_m02 -->|"contains"| node_m02_domain
node_m02 -->|"contains"| node_m02_main
node_m02_main -->|"uses"| node_m02_domain
node_m02_main -->|"prints"| node_console
node_m03 -->|"contains"| node_m03_domain
node_m03 -->|"contains"| node_m03_main
node_m03_main -->|"uses"| node_m03_domain
node_m03_main -->|"prints"| node_console
node_m04 -->|"contains"| node_m04_domain
node_m04 -->|"contains"| node_m04_main
node_m04_main -->|"uses"| node_m04_domain
node_m04_main -->|"prints"| node_console
node_m05 -->|"contains"| node_m05_domain
node_m05_domain -->|"prints"| node_console
node_m06 -->|"contains"| node_m06_domain
node_m06 -->|"contains"| node_m06_main
node_m06_main -->|"uses"| node_m06_domain
node_m06_main -->|"prints"| node_console
node_m07 -->|"contains"| node_m07_main
node_m07_main -->|"reads"| node_file_user
node_m07_main -->|"prints"| node_console
node_m08 -->|"contains"| node_m08_domain
node_m08 -->|"contains"| node_m08_main
node_m08_main -->|"uses"| node_m08_domain
node_m08_main -->|"prints"| node_console
node_m09 -->|"contains"| node_m09_domain
node_m09 -->|"contains"| node_m09_main
node_m09_main -->|"uses"| node_m09_domain
node_m09_domain -->|"queries"| node_database
node_m09_main -->|"prints"| node_console

click node_m01 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld"
click node_m01_domain "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld/src/com/novonordisk/domain"
click node_m01_main "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld/src/com/novonordisk/main"
click node_m02 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication"
click node_m02_domain "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication/src/com/novonordisk/domain"
click node_m02_main "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication/src/com/novonordisk/main"
click node_m08 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/08_Collections"
click node_m08_domain "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/08_Collections/src/com/novonordisk/domain/Employee.java"
click node_m08_main "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/08_Collections/src/com/novonordisk/main"
click node_m03 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance"
click node_m03_domain "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance/src/com/novonordisk/domain"
click node_m03_main "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance/src/com/novonordisk/main"
click node_m04 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/04_Abstract"
click node_m04_domain "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/04_Abstract/src/com/novonordisk/domain/Shape.java"
click node_m04_main "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/04_Abstract/src/com/novonordisk/main/ShapeMain.java"
click node_m05 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/05_Interface"
click node_m05_domain "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/05_Interface/src/com/novonordisk/domain"
click node_m06 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/06_Exception"
click node_m06_domain "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/06_Exception/src/com/novonordisk/domain/Calculations.java"
click node_m06_main "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/06_Exception/src/com/novonordisk/main/CalculationsMain.java"
click node_m07 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/07_FileIO"
click node_m07_main "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/07_FileIO/src/com/novonordisk/main"
click node_file_user "https://github.com/vshal5/nn_adv_java/blob/main/FileIO/User.txt"
click node_m09 "https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/09_JDBC"
click node_m09_domain "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/09_JDBC/src/main/java/com/novonordisk/domain/EmployeeCRUD.java"
click node_m09_main "https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/09_JDBC/src/main/java/com/novonordisk/main/EmployeeCRUDMain.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_m01,node_m01_domain,node_m01_main,node_m02,node_m02_domain,node_m02_main,node_m08,node_m08_domain,node_m08_main toneBlue
class node_m03,node_m03_domain,node_m03_main,node_m04,node_m04_domain,node_m04_main,node_m05,node_m05_domain,node_m06,node_m06_domain,node_m06_main toneAmber
class node_m07,node_m07_main,node_file_user,node_console toneMint
class node_m09,node_m09_domain,node_m09_main,node_database toneRose
```

## Components

### Core Java basics

Introductory modules focused on simple classes, control flow, and collections.

- [01 HelloWorld](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld): module · Introductory Java examples with several small domain classes and demo mains. · `CoreJava/01_HelloWorld`
- [Basics classes](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld/src/com/novonordisk/domain): domain package · Account, Addition, Circle, Employee, LoginDetails, NumberUtil. · `CoreJava/01_HelloWorld/src/com/novonordisk/domain`
- [Demo mains](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/01_HelloWorld/src/com/novonordisk/main): entrypoints · Runnable demos for the basic classes and simple examples. · `CoreJava/01_HelloWorld/src/com/novonordisk/main`
- [02 Banking](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication): module · Small banking model mixed with array and loop exercises. · `CoreJava/02_BankingApplication`
- [Account model](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication/src/com/novonordisk/domain): domain package · Basic banking account class. · `CoreJava/02_BankingApplication/src/com/novonordisk/domain`
- [Loop demos](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/02_BankingApplication/src/com/novonordisk/main): entrypoints · Banking entry points plus array and loop exercises. · `CoreJava/02_BankingApplication/src/com/novonordisk/main`
- [08 Collections](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/08_Collections): module · In-memory collection exercises over employee objects. · `CoreJava/08_Collections`
- [Employee](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/08_Collections/src/com/novonordisk/domain/Employee.java): domain class · Employee model used for collection examples. · `CoreJava/08_Collections/src/com/novonordisk/domain/Employee.java`
- [Collection mains](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/08_Collections/src/com/novonordisk/main): entrypoints · Drivers for collection operations and employee demos. · `CoreJava/08_Collections/src/com/novonordisk/main`

### OOP patterns

Modules demonstrating inheritance, abstraction, interfaces, and exceptions.

- [03 Inheritance](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance): module · Inheritance and polymorphism exercise around document formats. · `CoreJava/03_Inheritance`
- [Doc hierarchy](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance/src/com/novonordisk/domain): hierarchy · DocumentFormat base type with PDF, XLS, and CSV variants. · `CoreJava/03_Inheritance/src/com/novonordisk/domain`
- [Polymorphism mains](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/03_Inheritance/src/com/novonordisk/main): entrypoints · Drivers that exercise the document hierarchy. · `CoreJava/03_Inheritance/src/com/novonordisk/main`
- [04 Abstract](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/04_Abstract): module · Abstract class exercise centered on shapes. · `CoreJava/04_Abstract`
- [Shape](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/04_Abstract/src/com/novonordisk/domain/Shape.java): abstract type · Shape abstraction used to demonstrate abstract behavior. · `CoreJava/04_Abstract/src/com/novonordisk/domain/Shape.java`
- [Shape main](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/04_Abstract/src/com/novonordisk/main/ShapeMain.java): entrypoint · Runtime demo for the abstract shape model. · `CoreJava/04_Abstract/src/com/novonordisk/main/ShapeMain.java`
- [05 Interface](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/05_Interface): module · Interface contracts and implementations. · `CoreJava/05_Interface`
- [Contracts](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/05_Interface/src/com/novonordisk/domain): interfaces · Display and Greet define behavior; MyClass and User consume or implement them. · `CoreJava/05_Interface/src/com/novonordisk/domain`
- [06 Exception](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/06_Exception): module · Exception-handling exercise around calculations. · `CoreJava/06_Exception`
- [Calculations](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/06_Exception/src/com/novonordisk/domain/Calculations.java): logic class · Calculation logic that drives exceptional control flow. · `CoreJava/06_Exception/src/com/novonordisk/domain/Calculations.java`
- [Exception main](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/06_Exception/src/com/novonordisk/main/CalculationsMain.java): entrypoint · Driver that triggers and handles errors. · `CoreJava/06_Exception/src/com/novonordisk/main/CalculationsMain.java`

### IO

Modules that cross into local filesystem input.

- [07 FileIO](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/07_FileIO): module · File-reading and metadata demos using a local text file. · `CoreJava/07_FileIO`
- [File mains](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/07_FileIO/src/com/novonordisk/main): entrypoints · Read-file and metadata demos plus supporting class runner. · `CoreJava/07_FileIO/src/com/novonordisk/main`
- [User.txt](https://github.com/vshal5/nn_adv_java/blob/main/FileIO/User.txt): filesystem input · Concrete local file consumed by the File I/O examples. · `FileIO/User.txt`
- **Console**: output · Standard output used by the demo programs.

### Persistence

The JDBC module and its database boundary.

- [09 JDBC](https://github.com/vshal5/nn_adv_java/tree/main/CoreJava/09_JDBC): module · Maven-based JDBC persistence example. · `CoreJava/09_JDBC`
- [CRUD logic](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/09_JDBC/src/main/java/com/novonordisk/domain/EmployeeCRUD.java): data access · EmployeeCRUD encapsulates database operations. · `CoreJava/09_JDBC/src/main/java/com/novonordisk/domain/EmployeeCRUD.java`
- [CRUD main](https://github.com/vshal5/nn_adv_java/blob/main/CoreJava/09_JDBC/src/main/java/com/novonordisk/main/EmployeeCRUDMain.java): entrypoint · Launches the JDBC employee CRUD demo. · `CoreJava/09_JDBC/src/main/java/com/novonordisk/main/EmployeeCRUDMain.java`
- **Database**: external db · Relational database accessed through JDBC.

## Connections

- 01 HelloWorld → Basics classes: contains · Module groups the basic example classes.
- 01 HelloWorld → Demo mains: runs via · Demo entry points exercise the basic classes.
- Demo mains → Basics classes: uses · Main classes instantiate and call domain examples.
- Demo mains → Console: prints · Examples render results to standard output.
- 02 Banking → Account model: contains · Banking module centers on a small account model.
- 02 Banking → Loop demos: contains · Entry points cover banking and loop exercises.
- Loop demos → Account model: uses · Account demos call into the account class.
- Loop demos → Console: prints · Algorithm and banking demos write results to output.
- 03 Inheritance → Doc hierarchy: contains · Inheritance module defines one base type and variants.
- 03 Inheritance → Polymorphism mains: contains · Drivers demonstrate the hierarchy and polymorphism.
- Polymorphism mains → Doc hierarchy: uses · Main classes exercise the document format hierarchy.
- Polymorphism mains → Console: prints · Polymorphism demos report results on the console.
- 04 Abstract → Shape: contains · Abstract class exercise centers on Shape.
- 04 Abstract → Shape main: contains · Main class demonstrates abstract behavior.
- Shape main → Shape: uses · The driver works through the abstract shape type.
- Shape main → Console: prints · Shape demo output goes to the console.
- 05 Interface → Contracts: contains · Interface module defines contracts and implementations.
- Contracts → Console: prints · Interface examples are likely shown via console output.
- 06 Exception → Calculations: contains · Exception module houses the calculation logic.
- 06 Exception → Exception main: contains · Main class drives the exception scenarios.
- Exception main → Calculations: uses · Driver invokes calculation logic that can fail.
- Exception main → Console: prints · Handled errors and results are shown on the console.
- 07 FileIO → File mains: contains · File IO module groups the file demos.
- File mains → User.txt: reads · Read-file example consumes the bundled text file.
- File mains → Console: prints · Metadata and file contents are reported to output.
- 08 Collections → Employee: contains · Collections module centers on the employee model.
- 08 Collections → Collection mains: contains · Drivers demonstrate collection operations.
- Collection mains → Employee: uses · Collection examples operate on employee objects.
- Collection mains → Console: prints · Collection results are displayed on the console.
- 09 JDBC → CRUD logic: contains · JDBC module packages the data access logic.
- 09 JDBC → CRUD main: contains · Main class launches the persistence demo.
- CRUD main → CRUD logic: uses · Entry point calls the CRUD layer.
- CRUD logic → Database: queries · JDBC CRUD logic talks to an external relational database.
- CRUD main → Console: prints · CRUD results and status messages are printed.
