Giter Club home page Giter Club logo

Comments (4)

jokerping avatar jokerping commented on August 21, 2024

还有个问题,使用模块化的组件都需要import哪些模块内部的头问题,Protocol? router?

from zikrouter.

Zuikyo avatar Zuikyo commented on August 21, 2024
  1. 使用 framework 时只需要 @import ZIKRouter 或者 #import <ZIKRouter/ZIKRouter-umbrella.h>,内部区分多个 category 是正常的
  2. 使用模块时只需要引入模块的 protocol 头文件,通过 protocol 动态获取模块的 router

from zikrouter.

wzio avatar wzio commented on August 21, 2024
  1. 使用 framework 时只需要 @import ZIKRouter 或者 #import <ZIKRouter/ZIKRouter-umbrella.h>,内部区分多个 category 是正常的
  2. 使用模块时只需要引入模块的 protocol 头文件,通过 protocol 动态获取模块的 router

首先,我没有细看这个库,在实际应用中,各个模块的Protocols头文件应该放在哪里呢?
1)放在各个子模块里,
2)放在一个公共的模块(暂时叫它总接口模块)里
3)还是当成一个单独的小接口组件
如果是1,使用者不是还是要 import 这个子模块么
如果是2,这个总模块其实有点垃圾桶的意思
如果是3,当我有5个组件,我就要有10个framework
其实我也有组件化方案,目前使用的第二种方法,但是随着组件化的模块越来越多,这个垃圾桶的味道越来越大了,不知道你有没有好的想法

from zikrouter.

Zuikyo avatar Zuikyo commented on August 21, 2024
  1. 使用 framework 时只需要 @import ZIKRouter 或者 #import <ZIKRouter/ZIKRouter-umbrella.h>,内部区分多个 category 是正常的
  2. 使用模块时只需要引入模块的 protocol 头文件,通过 protocol 动态获取模块的 router

首先,我没有细看这个库,在实际应用中,各个模块的Protocols头文件应该放在哪里呢?
1)放在各个子模块里,
2)放在一个公共的模块(暂时叫它总接口模块)里
3)还是当成一个单独的小接口组件
如果是1,使用者不是还是要 import 这个子模块么
如果是2,这个总模块其实有点垃圾桶的意思
如果是3,当我有5个组件,我就要有10个framework
其实我也有组件化方案,目前使用的第二种方法,但是随着组件化的模块越来越多,这个垃圾桶的味道越来越大了,不知道你有没有好的想法

可以参考文档的 adapter 部分,以及更详细的文章里的说明:模块适配器

protocol 可以在每个使用它的模块里复制一份,或者用 required protocol 和 provided protocol 进行适配。

from zikrouter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.