Giter Site home page Giter Site logo

acme-architecture's Issues

Communication between services

Hey,

I have a question about Acme.Core layer, most specifically the Acme.Core.Service.

Based on your example and on code that I see around the internet, it's rare to see two services communicating between themselves.

Imagine you've service A and Service B, and you need to create a method on Service B that has some logic that is already implemented by a method on service A.

How do you deal with this? Do you add a reference to that service and invoke the corresponding method or do you repeat the logic on the service that you are working on?

I have the idea that each service method should map to one business use case. This means that it is not recommended to have methods calling each other, because they work independently and each one of them solves a specific use case (the method you are calling might invoke unitOfWork.Commit(), meaning your pending changes will be saved without you knowing it, or you can have your method inside a transaction and the method you're calling might take too long to run).

I'm a little bit confused about this topic because on one side I want to promote code reuse but then I start thinking about all the problems that might occur with DbContex, TransactionScopes, etc.

Support multiple DbContext

Hello again,

I was trying a different strategy with your architecture, which is separating the DbContext into multiple DbContexts (I'm trying to apply some DDD patterns).

However, I'm not having an easy time with IUnitOfWork because it is coupled with the AcmeDataContext. I was thinking about creating a IUnitOfWork where T could be a DbContext, but this means that the Core layer would need to have a reference to Entity Framework, which I was avoiding.

Do you have any ideas on how to decouple IUnitOfWork from AcmeDataContext while still being capable of using IoC to register multiple DbContexts?

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.