Strategic Evolution Plan: Deep Dive Blueprint
This document provides the detailed technical and functional strategies for the two upcoming modernization sessions. The goal is to decouple the Vital Core from the legacy monolith and establish a Single Source of Truth for business logic.
🏗️ Session 1: Vital Core Extraction (Technical Strategy)
[!TIP] Detailed Proposal Available: See specs/proposals/vital_core_extraction/ for complete analysis and implementation plan.
Problem Statement
The EITWEP.Model project is the "Anchor of the Monolith". It contains the persistence layer but is heavily coupled with System.Web, System.Drawing, and custom interfaces, preventing it from being used in a modern .NET environment.
1. The "Coupling Trap" Analysis
The entities are generated as partial classes. Custom logic is added in EntityPartials/*.cs. Many of these partials implement legacy interfaces:
IWepActivityable,ICommunicable,IEITLogItemable.- These interfaces often depend on the very same
EITWEP.Model(Circular dependency) or on legacy common libraries.
2. Implementation Blueprint (Phased Approach)
Phase A: Abstractions Shim (.NET Standard 2.1)
Create a new project Wep.Core.Abstractions.
- Move non-dependent interfaces (
IWepActivityable, etc.) here. - Any implementation detail tied to legacy
DataContextmust be abstracted further.
Phase B: Entity Extraction (Wep.Core.Data)
Extract the LLBLGen-generated POCOs and the WEPV2DataContext configuration.
- Target:
.NET Standard 2.1. - Strategy: Use a "Data-Only" project structure.
- Type Forwarding: To avoid breaking references in the 1M+ lines monolite, we will use:
[assembly: TypeForwardedTo(typeof(EITWEP.EntityClasses.OrderHeader))]
This allows the legacy assembly to "find" the type in the new assembly without moving the calling code.
Phase C: Logic Separation
- Pure Logic: Static helpers and simple getters move to
Wep.Core.Domain. - Impure Logic: Logic depending on
System.Web.HttpContextor legacy UI components stays inWepNG_MVCin the "Impure Partial" extension.
3. Mermaid Architecture Vision
📄 Session 2: Functional Specifications Strategy (Knowledge Strategy)
Goal
To stop the "Archaeological Coding" (reading legacy code to understand rules) by creating a human-readable, executable-ready specification bank.
1. The Specification Workflow
The transition follow a strict "Cleanroom" process:
- Code Discovery: Locate the "God Method" (e.g.,
PaymentsToProviderComponentService.ImportFile). - Logic Extraction: Agent parses the spaghetti code to extract the underlying business rules (If/Else, Math, Validations).
- Gherkin Drafting: Write a
.featurefile documenting scenarios. - Use Case Mapping: Link the Gherkin to the use_case_template.md.
- User Validation: The USER approves the spec as the "Source of Truth".
2. Prioritization Matrix
We will start with the modules that are most critical for the .NET 10 Migration:
| Priority | Module | Reason |
|---|---|---|
| P0 | Fee Calculation | Tightly coupled with persistence, varies by product/country. |
| P1 | Payment Imports | High risk, currently using fire-and-forget async. |
| P2 | Invoicing Logic | Direct impact on finance and legal compliance. |
| P3 | OMGT Orders | The core workflow engine. |
3. Deliverables per Module
docs/functional_specs/[Module]/[Feature].feature(Gherkin Scenarios)docs/functional_specs/[Module]/[Feature].md(Detailed Business Rules & Use Cases)docs/architecture/glossary.md(Updates for domain terminology)
🚦 Next Steps Decision Point
- Approve Blueprint: Confirm if this technical vision aligns with the desired evolution.
- Execute Session 1: Review the detailed analysis and implementation plan.
- Execute Session 2: Select the first "God Method" for functional extraction.
📂 Related Documents
Session 1: Vital Core Extraction
- 📋 README – Proposal index
- 🔍 Session 1 Analysis – Deep technical analysis
- 📐 Implementation Plan – Phased approach