How vshal5/nn_adv_java works
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: novonordisk/main Demo mains · novonordisk/main Loop demos · novonordisk/main Collection mains · novonordisk/main Polymorphism mains
Components 28
Core Java basics
Introductory modules focused on simple classes, control flow, and collections.
- 01 HelloWorld · Introductory Java examples with several small domain classes and demo mains.
CoreJava/01_HelloWorld - Basics classes · Account, Addition, Circle, Employee, LoginDetails, NumberUtil.
CoreJava/01_HelloWorld/src/com/novonordisk/domain - Demo mains · Runnable demos for the basic classes and simple examples.
CoreJava/01_HelloWorld/src/com/novonordisk/main - 02 Banking · Small banking model mixed with array and loop exercises.
CoreJava/02_BankingApplication - Account model · Basic banking account class.
CoreJava/02_BankingApplication/src/com/novonordisk/domain - Loop demos · Banking entry points plus array and loop exercises.
CoreJava/02_BankingApplication/src/com/novonordisk/main - 08 Collections · In-memory collection exercises over employee objects.
CoreJava/08_Collections - Employee · Employee model used for collection examples.
CoreJava/08_Collections/src/com/novonordisk/domain/Employee.java - Collection mains · 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 · Inheritance and polymorphism exercise around document formats.
CoreJava/03_Inheritance - Doc hierarchy · DocumentFormat base type with PDF, XLS, and CSV variants.
CoreJava/03_Inheritance/src/com/novonordisk/domain - Polymorphism mains · Drivers that exercise the document hierarchy.
CoreJava/03_Inheritance/src/com/novonordisk/main - 04 Abstract · Abstract class exercise centered on shapes.
CoreJava/04_Abstract - Shape · Shape abstraction used to demonstrate abstract behavior.
CoreJava/04_Abstract/src/com/novonordisk/domain/Shape.java - Shape main · Runtime demo for the abstract shape model.
CoreJava/04_Abstract/src/com/novonordisk/main/ShapeMain.java - 05 Interface · Interface contracts and implementations.
CoreJava/05_Interface - Contracts · Display and Greet define behavior; MyClass and User consume or implement them.
CoreJava/05_Interface/src/com/novonordisk/domain - 06 Exception · Exception-handling exercise around calculations.
CoreJava/06_Exception - Calculations · Calculation logic that drives exceptional control flow.
CoreJava/06_Exception/src/com/novonordisk/domain/Calculations.java - Exception main · 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 · File-reading and metadata demos using a local text file.
CoreJava/07_FileIO - File mains · Read-file and metadata demos plus supporting class runner.
CoreJava/07_FileIO/src/com/novonordisk/main - User.txt · Concrete local file consumed by the File I/O examples.
FileIO/User.txt - Console · Standard output used by the demo programs.
Persistence
The JDBC module and its database boundary.
- 09 JDBC · Maven-based JDBC persistence example.
CoreJava/09_JDBC - CRUD logic · EmployeeCRUD encapsulates database operations.
CoreJava/09_JDBC/src/main/java/com/novonordisk/domain/EmployeeCRUD.java - CRUD main · Launches the JDBC employee CRUD demo.
CoreJava/09_JDBC/src/main/java/com/novonordisk/main/EmployeeCRUDMain.java - Database · Relational database accessed through JDBC.
Connections 34
- 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.