Skip to content

Let sdk and sdk-reactor reuse common code #3

Open

Description

@seeflood

Let sdk and sdk-reactor reuse common code and reduce redundencies.

See mosn/layotto#349 (comment)

Activity

  1. kevinten10 commented on Dec 8, 2021

    @kevinten10

    Can I put the entity class in the common part first?

  2. seeflood commented on Dec 8, 2021

    @seeflood
    MemberAuthor

    @kevinten10 Do you mean the request and response object under the domain package?
    image
    Sure !
    Since the domain objects in spec/sdk/runtime/v1/domain have already been used by users(except the lock related objects,e.g. TryLockRequest ),please keep them compatible when refactoring the code.
    For example,we should keep the existing fields and package name of the objects in spec/sdk/runtime/v1/domain not changed after moving them into a new module. Of course , we can add new fields in them.

  3. seeflood commented on Dec 8, 2021

    @seeflood
    MemberAuthor

    image

  4. added a commit that references this issue on Dec 8, 2021
  5. kevinten10 commented on Dec 11, 2021

    @kevinten10

    Yes, I will keep the unchanged of sdk-runtime.

    I plan to move all the definitions of all Entity and Runtime interfaces to the sdk-domain module, which will be consistent with the current sdk-runtime module, and then the sdk-reactor module also uses these definitions.

    Then define the RxRuntime interface Extends Runtime interface and add Reactor's API implementation.

    At the same time, the sdk-domain will use reactor-core with compile scope, which will not affect users who use non-reactor sdk.

    At present, I am doing these work.

  6. seeflood commented on Dec 12, 2021

    @seeflood
    MemberAuthor

    @kevinten10 Thanks for your details!
    I try to draw a picture to illustrate your design:
    image
    Is my understanding correct?

    At the same time, the sdk-domain will use reactor-core with compile scope, which will not affect users who use non-reactor sdk.

    I didn't understand.From my understanding, if we configurate the maven dependency to be compile scope, users who use non-reactor sdk will also be affected. Could you give more details?

  7. kevinten10 commented on Dec 12, 2021

    @kevinten10

    Give me some time for me to try, how can the dependencies in the SDK not propagate to the dependencies of the application

  8. seeflood commented on Dec 13, 2021

    @seeflood
    MemberAuthor

    image
    @kevinten10 Maybe this way? Extract the common domain objects into a new module and leave those not common in their own module

  9. kevinten10 commented on Dec 14, 2021

    @kevinten10

    All right! I will refactor it in #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions