How couvain/stocksemences works
Project type and purpose
• StockSemences is a two-tier, desktop‐based inventory management application written in Java (Swing).
• Its purpose is to let users manage seed stock, plants, families, distributors, and movements in a PostgreSQL database.
File structure
• Top-level folders:
• src: Java source code (UI screens, business/domain classes, interfaces, utility widgets)
• lib: external libraries (PostgreSQL JDBC driver, JCalendar)
• jar: packaged application (GraineStock.jar)
• SQL / postgres: database scripts to create and populate the PostgreSQL schema
• Patterns:
• UI layer: Ecran*.java classes (Swing frames/panels)
• Domain/model layer: C*.java classes implementing IObjetMetier or IObjetStock interfaces
• Deployment: single‐machine desktop app connecting over TCP/IP to PostgreSQL on localhost (port 5432).
README for additional insights
• Confirms JavaSE-1.6, PostgreSQL 9.4, Swing-based UI, dependencies in lib, and installation scripts.
• No explicit service or middleware layer beyond JDBC.
Main components and relationships
a. Presentation Layer (Java Swing UI)
• Dependencies: each screen imports and invokes methods on domain objects (CPlante, CFamillePlante, etc.).
b. Domain Model Layer
• Interfaces: IObjetMetier, IObjetStock define contracts for CRUD operations, stock adjustments, etc.
c. Data Access (JDBC)
• PostgreSQL JDBC driver (postgresql-9.4-1201.jdbc4.jar) as a component used by the domain objects.
• Domain objects internally open JDBC connections, execute SQL (scripts under SQL/ and postgres/).
d. Database
• PostgreSQL instance (port 5432), with schemas and tables created by base_amap.sql, create_database.sql, data_amap_*.sql.
e. External Libraries & Utilities
• JCalendar (jcalendar-1.4.jar) for date-picker widgets in UI
• Utility components: JNumberTextField, StarRater
Architectural patterns and design principles
• Two-tier architecture: desktop UI ↔ domain (business logic + data access) ↔ PostgreSQL DB
• Model-View separation: UI screens (View + Controller) call Model classes (C*)
• Use of interfaces (IObjetMetier, IObjetStock) to decouple UI from concrete implementations
• Reusable widgets and table-models (Tableau*.java) to render lists of domain objects