Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
business_logic
reflection
README.md
base_module.cpp
base_module.h
entrance.cpp
make.sh

README.md

目录结构

.
└──how-to-extend-business
    ├── entrance.cpp    # 相当于系统框架的 main 函数入口
    ├── base_module.cpp # 相当于系统框架的基类
    ├── base_module.h
    ├── business_logic  # 扩展的业务逻辑目录
    │   ├── business_a.cpp
    │   ├── business_a.h
    │   ├── business_b.cpp
    │   └── business_b.h
    ├── make.sh         # 编译脚本
    └── reflection      # 反射宏
        ├── class_register.h
        ├── class_register_test.cc
        ├── class_register_test_helper.cc
        └── class_register_test_helper.h

原理

用继承和反射机制实现业务扩展