You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "GOODBOY008 (via GitHub)" <gi...@apache.org> on 2025/11/14 03:26:38 UTC

[I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

GOODBOY008 opened a new issue, #686:
URL: https://github.com/apache/fesod/issues/686

   ## Abstract
   
   This proposal suggests restructuring Apache Fesod from a monolithic module into a multi-module Maven project, separating functionality by Excel format (CSV, XLS, XLSX). This change will improve modularity, reduce dependency bloat, and provide users with more flexibility in choosing which formats to support.
   
   ## Motivation
   
   ### Current Challenges
   
   The current monolithic structure of Apache Fesod has several limitations that impact both users and contributors:
   
   1. **Unnecessary Dependencies**: Users who only need CSV support must still include POI libraries (for XLS/XLSX), adding ~10MB of dependencies.
   
   2. **Tight Coupling**: Format-specific code (CSV, XLS, XLSX) is intermingled within the same module, making it difficult to:
      - Understand which code handles which format
      - Modify one format without risk of affecting others
      - Add new formats without touching existing code
   
   3. **Complex Codebase Navigation**: The current structure uses conditional logic (switch statements) to handle different formats, scattered across multiple classes.
   
   4. **Testing Complexity**: Unit tests for all formats are mixed together, making it harder to:
      - Run format-specific tests
      - Identify which tests cover which functionality
      - Maintain test isolation
   
   5. **Example Code Confusion**: The fesod-examples module contains a mix of actual examples (in `demo` package) and temporary test code (in `temp` package), with unclear purpose.
   
   ### Benefits of Multi-Module Architecture
   
   **For End Users**:
   - Smaller dependency footprint (include only needed formats)
   
   **For Contributors**:
   - Easier to understand and modify format-specific code
   - Reduced risk of cross-format bugs
   - Clearer test organization
   
   **For the Project**:
   - Better separation of concerns
   - Potential for independent format evolution
   - Clearer module boundaries and responsibilities
   - Improved code maintainability
   
   ## Current Architecture
   
   ### Existing Module Structure
   
   Apache Fesod currently consists of two Maven modules:
   
   | Module         | Artifact ID                           | Description                                | Current Issues                           |
   |----------------|---------------------------------------|--------------------------------------------|------------------------------------------|
   | fesod          | org.apache.fesod:fesod:1.3.0          | Main library with all Excel format support | Monolithic, all formats bundled together |
   | fesod-examples | org.apache.fesod:fesod-examples:1.3.0 | Examples and test code                     | Mixed examples and temporary code        |
   
   ## Proposed Architecture
   
   ### Proposed Module Structure
   
   The refactored project will have the following module hierarchy:
   
   ```
   fesod-parent (root POM)
   ├── fesod-core (shared infrastructure)
   ├── fesod-csv (CSV format support)
   ├── fesod-xls (XLS/BIFF8 format support)
   ├── fesod-xlsx (XLSX/OOXML format support)
   ├── fesod-all (backward compatibility aggregator)
   └── fesod-examples (usage examples)
   ```
   
   ## Dependency Graph
   
   ```mermaid
   graph TD
       A[fesod-core] --> B[Common Dependencies]
       C[fesod-csv] --> A
       C --> D[commons-csv]
       E[fesod-xls] --> A
       E --> F[poi]
       G[fesod-xlsx] --> A
       G --> H[poi-ooxml]
       H --> F
       I[fesod-examples] --> C
       I --> E
       I --> G
       I --> J[Spring Boot]
       B --> K[ehcache]
       B --> L[commons-io]
       B --> M[slf4j-api]
   ```
   
   ## Module Interaction Patterns
   
   ### Read Operation Flow (Sample)
   
   ```mermaid
   sequenceDiagram
       participant User
       participant Factory
       participant Core
       participant FormatModule as Format Module (CSV/XLS/XLSX)
       
       User->>Factory: FastExcel.read(file)
       Factory->>Core: Detect format (ExcelTypeEnum)
       Factory->>FormatModule: ServiceLoader discover provider
       FormatModule->>Factory: Return format provider
       Factory->>FormatModule: Create ExcelReader
       FormatModule->>Core: Use core metadata & converters
       FormatModule->>User: Return configured reader
       User->>FormatModule: Execute read operation
       FormatModule->>Core: Fire events & process data
       Core->>User: Deliver parsed data via listeners
   ```
   
   ## Compatibility and Migration
   
   ### Backward Compatibility Strategy
   
   To ensure a smooth transition for existing users, we will provide multiple compatibility mechanisms:
   
   ### For Existing Users
   
   Users who upgrade will have two migration paths:
   
   **Option 1: No Changes Required (Recommended for initial adoption)**
   
   Continue using the aggregator module with the same Maven coordinates:
   
   ```xml
   <dependency>
       <groupId>org.apache.fesod</groupId>
       <artifactId>fesod</artifactId>
       <version>2.0.0</version>
   </dependency>
   ```
   
   The `fesod` artifact will become an aggregator that includes all format modules, maintaining complete backward compatibility.
   
   **Option 2: Selective Module Usage (For optimization)**
   
   Choose only the formats needed:
   
   ```xml
   <!-- Core + CSV only -->
   <dependency>
       <groupId>org.apache.fesod</groupId>
       <artifactId>fesod-core</artifactId>
       <version>2.0.0</version>
   </dependency>
   <dependency>
       <groupId>org.apache.fesod</groupId>
       <artifactId>fesod-csv</artifactId>
       <version>2.0.0</version>
   </dependency>
   ```
   
   ---
   
   *This proposal is open for community discussion and will be updated based on feedback.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "delei (via GitHub)" <gi...@apache.org>.
delei commented on issue #686:
URL: https://github.com/apache/fesod/issues/686#issuecomment-3566442970

   > I need `fesod-ai`, as I am currently developing similar features.
   
   Welcome, We shall complete the task of splitting the multi-module system ASAP. At that time,  welcome to add this feature and sub-module.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on issue #686:
URL: https://github.com/apache/fesod/issues/686#issuecomment-3566428262

   > A very good proposal. FYI, regarding the division of your Maven multi-module project, I believe it could be optimised.
   > 
   > For now, I propose dividing the modules as follows:
   > 
   > fesod-parent                            # Root
   > ├── fesod-all                           # All sub-modules
   > ├── fesod-bom                           # BOM package
   > ├── fesod-common                        # General modules and utility classes
   > ├── fesod-examples                      # Usage examples
   > └── fesod-sheet                         # For spreadsheets(csv,excel)
   > In the future, we can add more modules, such as:
   > 
   > ├── fesod-ai                            # MCP
   > ├── fesod-benchmark                     # JMH
   > ├── fesod-doc                           # For word
   > ├── fesod-spring                        # Spring Framework
   > ├── fesod-quarkus                       # Quarkus Framework
   > BTW, regarding file types, we have adopted a multi-core-class approach. We will establish our own branded terminology for core classes rather than creating separate terms for each specific file type. For instance, `FesodSheet` will be used for spreadsheet-type files.
   
   I need `fesod-ai`, as I am currently developing similar features.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "alaahong (via GitHub)" <gi...@apache.org>.
alaahong commented on issue #686:
URL: https://github.com/apache/fesod/issues/686#issuecomment-3536193257

   A good suggestion, as I guess the original design mixed xlsx/xls/csv as provided the universal usage, and user easy to switch by pass type(XLSX/XLS/CSV), might keep sheet to cover three types is also fine in the future.
   And meanwhile ,agree to split with multiple modules, but still should discuss the module types later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "alaahong (via GitHub)" <gi...@apache.org>.
alaahong commented on issue #686:
URL: https://github.com/apache/fesod/issues/686#issuecomment-3566489199

   > > A very good proposal. FYI, regarding the division of your Maven multi-module project, I believe it could be optimised.
   > > For now, I propose dividing the modules as follows:
   > > fesod-parent                            # Root
   > > ├── fesod-all                           # All sub-modules
   > > ├── fesod-bom                           # BOM package
   > > ├── fesod-common                        # General modules and utility classes
   > > ├── fesod-examples                      # Usage examples
   > > └── fesod-sheet                         # For spreadsheets(csv,excel)
   > > In the future, we can add more modules, such as:
   > > ├── fesod-ai                            # MCP
   > > ├── fesod-benchmark                     # JMH
   > > ├── fesod-doc                           # For word
   > > ├── fesod-spring                        # Spring Framework
   > > ├── fesod-quarkus                       # Quarkus Framework
   > > BTW, regarding file types, we have adopted a multi-core-class approach. We will establish our own branded terminology for core classes rather than creating separate terms for each specific file type. For instance, `FesodSheet` will be used for spreadsheet-type files.
   > 
   > I need `fesod-ai`, as I am currently developing similar features.
   
   Can you try to propose the detail before commit more locally?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "delei (via GitHub)" <gi...@apache.org>.
delei commented on issue #686:
URL: https://github.com/apache/fesod/issues/686#issuecomment-3530729978

   A very good proposal. FYI, regarding the division of your Maven multi-module project, I believe it could be optimised.
   
   For now, I propose dividing the modules as follows:
   
   ```bash
   fesod-parent                            # Root
   ├── fesod-all                           # All sub-modules
   ├── fesod-bom                           # BOM package
   ├── fesod-common                        # General modules and utility classes
   ├── fesod-examples                      # Usage examples
   └── fesod-sheet                         # For spreadsheets(csv,excel)
   ```
   
   In future, we can introduce more modules
   
   ```bash
   ├── fesod-ai                            # MCP
   ├── fesod-benchmark                     # JMH
   ├── fesod-doc                           # For word
   ├── fesod-spring                        # Spring Framework
   ├── fesod-quarkus                       # Quarkus Framework
   
   ```
   
   BTW, regarding file types, we have adopted a multi-core-class approach. We will establish our own branded terminology for core classes rather than creating separate terms for each specific file type. For instance, `FesodSheet` will be used for spreadsheet-type files.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "psxjoy (via GitHub)" <gi...@apache.org>.
psxjoy closed issue #686: [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture
URL: https://github.com/apache/fesod/issues/686


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [DISCUSS] Proposal: Refactor Fesod into Multi-Module Architecture [fesod]

Posted by "GOODBOY008 (via GitHub)" <gi...@apache.org>.
GOODBOY008 commented on issue #686:
URL: https://github.com/apache/fesod/issues/686#issuecomment-3540104006

   @delei @alaahong Thanks for getting involved in this discussion. It would be helpful if you could share the project’s roadmap to facilitate the next steps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org