Refactoring JD Express Refund, Amount Calculation, and Reverse Billing Modules: Design, Implementation, and Outcomes

This article examines the background, refactoring strategy, stability safeguards, and results of redesigning JD Express's refund, amount‑calculation, and reverse‑billing backend modules, highlighting the use of design patterns, incremental testing, and code‑quality improvements to reduce complexity and enhance system reliability.

JD Retail Technology
JD Retail Technology
JD Retail Technology
Refactoring JD Express Refund, Amount Calculation, and Reverse Billing Modules: Design, Implementation, and Outcomes

Background : JD Express refund, amount calculation, and reverse‑billing modules suffered from tangled code, duplicated logic, and unclear domain boundaries, resulting in high maintenance costs and system instability.

Refactoring Approach : A combination of small‑scale and large‑scale refactoring was applied, leveraging design patterns such as abstract‑factory, strategy, and chain‑of‑responsibility. Code smells were identified, large classes were split, methods extracted, and redundant logic consolidated into unified services.

System Stability Measures : The refactor was performed in incremental steps with comprehensive test cases, gray‑release isolation, continuous monitoring, performance testing, and thorough team code reviews to ensure no regression and maintain reliability.

Results : Development and maintenance costs were reduced, code quality and system stability improved, business boundaries became clearer, extensibility increased, and developers gained deeper understanding of refactoring principles.

Code Showcase : Before‑and‑after diagrams illustrate the consolidation of multiple calculation logics into a single, pattern‑driven implementation; the core amount‑calculation method was reduced to four steps, and a chain‑of‑responsibility handles item‑ and SKU‑level calculations.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Microservices
JD Retail Technology
Written by

JD Retail Technology

Official platform of JD Retail Technology, delivering insightful R&D news and a deep look into the lives and work of technologists.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.