Mobile Development 14 min read

Unified Online Store Product SDK: Architecture, Modularization, and Mobile Gateway Integration

The unified online‑store product SDK consolidates Retail and Micro‑Mall modules into a reusable, Bifrost‑mediated component that accesses host‑app data via a defined interface, adopts standardized UI elements, routes through a mobile‑gateway backend, and thus eliminates duplication, streamlines maintenance, and accelerates feature delivery across Youzan’s SaaS platforms.

Youzan Coder
Youzan Coder
Youzan Coder
Unified Online Store Product SDK: Architecture, Modularization, and Mobile Gateway Integration

In e‑commerce SaaS, the product module is the core component that supports everything from browsing a merchant’s homepage to completing an order. It must provide basic, universal features while also being extensible to meet the rapidly changing needs of different merchants.

The online‑store product SDK, used in Youzan’s App for both Micro‑Mall and Retail scenarios, delivers the data capabilities required for online purchasing. This article explains how the SDK was consolidated and the technical considerations involved.

Why Build the SDK

Two separate teams maintained similar product management and editing pages for Retail and Micro‑Mall, leading to:

Duplicate development and inconsistent implementations across teams.

Non‑standardized UI and visual designs.

Time‑consuming coordination with multiple business owners (Micro‑Mall, Retail, Beauty, Education, etc.).

Poor code maintainability and slow response to product changes.

To address these pain points, a technical transformation project was launched to merge the Retail and Micro‑Mall product modules into a single, reusable online‑store product SDK.

Business Overview

Youzan Micro‑Mall provides a mobile e‑commerce solution for online stores, while Youzan Retail targets offline stores with a unified product library that serves both store‑front and online channels.

The merged SDK must support a wide range of shop types and product categories (physical goods, virtual goods, coupons, cross‑border items, fresh produce, hotel bookings, etc.), each with its own configuration.

Technical Overview

The App architecture consists of three layers:

Application layer – modular business components that depend only on a common business library.

Common business layer – reusable business components across Apps.

Base library – cross‑App utility components.

Product functionality originally lived in the application layer. By moving it to the common business layer, the SDK becomes reusable across multiple Apps.

1. Modularization

The project uses a self‑developed modular middleware (Bifrost) that routes calls between modules via defined interfaces. The key class is moduleService, which encapsulates the product module’s implementation. Moving the module simply involves extracting its implementation and the moduleService definition.

2. Upward Data Dependency

Product modules need data such as login, account, and shop information. Since the SDK now resides in the common business layer, it cannot depend on application‑layer services. Two solutions were considered:

Passing data during SDK initialization – impractical due to unpredictable data change points.

Defining an interface that the host App implements. The SDK calls this interface via Bifrost to obtain required data.

The second approach was adopted. Example interface definition (iOS):

@protocol XXInterface<NSObject>
@required
- (XXShopInfo *)getXXShopInfo;
@optional
- (XXAdminInfo *)getXXAdminInfo;
@end

Host App implementation:

#import <Bifrost/Bifrost.h>
#import <XXSDK/XXInterface.h>
#import "AppCommonUtil.h"

@interface AppXXInterfaceImp : NSObject <XXInterface>
@end

@implementation AppXXInterfaceImp
- (void)setup {
    [Bifrost registerService:XXInterface withModule:self];
}
- (XXShopInfo *)getXXShopInfo {
    return [[AppCommonUtil getShopInfo] convertToXXShopInfoModel];
}
@end

SDK usage example:

#import <Bifrost/Bifrost.h>

@interface XXSomeClass
@end

@implementation XXSomeClass
- (void)someMethod {
    [[Bifrost moduleByService:XXInterface] getXXShopInfo];
}
@end

The SDK therefore exposes two main classes: moduleService (the service provider) and interface (the contract the host App must implement).

3. Design Standards

Earlier UI components lacked standardization, causing duplicated and inconsistent UI across teams. The mobile design team introduced a standardized component library, which the SDK now adopts to improve consistency and reduce duplicated effort.

4. Mobile Gateway

The “mobile gateway” is a standard Java backend service maintained by the mobile team. It centralizes data provision for the App, allowing different business owners to supply their own data without tight coupling. Migrating the product APIs to the mobile gateway unifies the call chain and reduces coordination overhead.

Conclusion

The unified product SDK is now a common business component that can be integrated by multiple business lines without redundant development.

Functionality and UI have been standardized across Retail and Micro‑Mall, aligning with Youzan’s latest SaaS design system.

A single team maintains the SDK, enabling faster response to product requirements and improving development efficiency.

The first phase of the online‑store product SDK transformation is complete, laying the groundwork for future component extraction and dynamic configuration support.

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.

e‑commerceSDKiOSmodularizationAndroid
Youzan Coder
Written by

Youzan Coder

Official Youzan tech channel, delivering technical insights and occasional daily updates from the Youzan tech team.

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.