Code Monkey home page Code Monkey logo

Comments (4)

mattia-battiston avatar mattia-battiston commented on June 27, 2024

Hi Hung

The easiest thing you can do is extract the DoesPostEsisted class to a common package and reuse it from both use cases. I don't see anything wrong with it, as it sounds like it's part of your business logic.

I hope this answer your questions
Cheers

from clean-architecture-example.

hukacode avatar hukacode commented on June 27, 2024

Hi @mattia-battiston

Thank you so much for your comment.
Do you mean I should create another common use case and use it in other use cases?

Example:

  • Put common interactor in common package:
    com.example.core.usecase.common.DoesPostEsisted.java

  • Used in:
    com.example.core.usecase.getcapacity.GetCapacityForExchangeUseCase.java

  • And
    com.example.core.usecase.getSomething.GetSomethingForSomethingUseCase.java

Edit:
I think it should be called Boundaries, not Interactors, is it right?

Thanks,
Hung.

from clean-architecture-example.

mattia-battiston avatar mattia-battiston commented on June 27, 2024

yes, that's what I mean. There's nothing wrong in extracting duplicate code, as long as you still respected the fact that in core we only want business logic.

Not sure what you mean by boundaries vs interactors though?

Mattia

from clean-architecture-example.

hukacode avatar hukacode commented on June 27, 2024

I'm confusing, Boundaries are interface, Interactors are Usecases.
Maybe DoesPostEsisted.java is Boundary and used in others Usecases.
I will search Google for more details.

Thank you for supporting, I really appreciate it.

Have a good day!
Hung

from clean-architecture-example.

Related Issues (10)

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.