当前位置:网站首页>SAP Spartacus Reference App Structure
SAP Spartacus Reference App Structure
2022-06-11 10:50:00 【Hua Weiyun】
https://sap.github.io/spartacus-docs/reference-app-structure/
The concept is in SAP Spartacus 3.1 Version to introduce .
This Reference App Structure yes SAP Recommend that customers build their own Spartacus Storefront Reference used when .
Spartacus Contains a number of that can lazy load Of feature libraries.
Customizations and third-party code add further complexity, and you can end up with modules that are difficult to maintain because they mix too many of these elements together.
Customization and third-party code further increase the complexity of the project , If not handled properly , It's easy to pile up a lot of module, Difficult to maintain .
This can be solved by defining and adhering to a standardized structure, such as the Spartacus reference app structure.
And follow Spartacus reference app structure To develop , Can avoid such problems .
Having a standardized structure also makes it easier to onboard new developers to your project, to handle external support cases, and to take care of audits.
There is a set of standard engineering structures , It is also convenient for new developers to enter the project , Quickly familiarize yourself with the project and get started .
structure

1. AppModule

2. SpartacusModule

3.BaseStorefrontModule

from @spartacus/storefront Import in , Then export .
4.SpartacusFeatureModule

5. feature related modules

6. To configure module

Every Angular application has a root app module, usually named AppModule. In the reference app strcuture, this module includes application-wide imports, and avoids complex module imports related to Spartacus by handling only one SpartacusModule.
Every Angular Every app has one root app module, Usually named AppModule. stay SAP Spartacus reference app structure in ,AppModule Contains application level imports:

Both Angular Router and NgRx are used by Spartacus, but these affect the global application, so they are kept outside of the SpartacusModule and are imported directly in the AppModule.
As can be seen from the above figure ,StoreModule and EffectsModule etc. module, Because other customized development of the entire application may also be used , So directly in AppModule in import, Instead of putting SpartacusModule in .
SpartacusModule It consists of three parts :

- The BaseStorefrontModule, which encapsulates core Spartacus imports that are usually required by most Spartacus applications.
Contains any Spartacus Applications are required imports.
The BaseStorefrontModule is imported directly from @spartacus/storefront.
- The SpartacusFeaturesModule, which encapsulates Spartacus features.

Spartacus feature It's divided into two parts : come from @Spartacus/storefront and features Under folder modules.
- The SpartacusConfigurationModule, which encapsulates the general Spartacus configuration.
Configuration information :
Feature-specific configurations can be kept either in feature modules, or in the SpartacusConfigurationModule. Keeping them in feature modules helps to maintain a good separation of concerns, so it is generally recommended.
feature Related configuration information , It's recommended to put feature modules in , So as to follow the principle of separation of concerns .
边栏推荐
猜你喜欢

Pyspark case series 4-dataframe output to a single folder solution

Interpreting USB3.0 test items

Fix the problem that uicollectionview does not reach the bottom security zone

Global pooling – pytoch

Wechat cloud development al short video one click face changing applet source code

Leetcode 1952. 三除数

MYSQL(九)

Pyramidtnt: TNT with characteristic pyramid structure

Team level safety training, new employee induction training education courseware, full content ppt application

杰理之获取 BLE 查看代码异常复位等异常情况原因【篇】
随机推荐
NGUI,地图放大缩小
Why is Web3 a game changer for the "creator economy"
Pl/sql compilation check in kingbasees
使用RSA与base64对字符串进行加密解密
链接器和链接器选项、运行时库和运行时库设置、配置设置、生成过程和方法
云开发mbti人格类型测试助手微信小程序源码
【MYSQL】存储过程的使用
[K-means] K-means learning examples
Wechat cloud development al short video one click face changing applet source code
Is it safe to open an account online? Can ordinary people drive it?
基于位置服务(LBS)的SSM的框架实现的兴趣社交软件平台设计与实现
Implementation of competition scoring system based on C language
杰理之BLEPR0 和 PR1 当普通 IO 口使用【篇】
杰理之获取 BLE OTA 双备份升级(只能用于 4Mbits 以上的芯片)【篇】
网上开户是安全的吗?普通人可以开吗?
MySQL foundation part common constraints summary part 2
MYSQL(九)
MySQL download, installation and use - complete and detailed steps
金仓数据库KingbaseES中的PL/SQL 编译检查
MN梦奈宝塔主机系统V1.5版本发布