thomaskioko/tv-maniac

questions

Opened this issue · 1 comments

First, this is one of the best examples on GitHub, I all most reviews more than 100 code base on GitHub
just I have few questions please if you could help me improving myself,

  1. why do you think creating a special module for logger contains a few classes is better than putting logger in util module for example, because each module will add a complexity for the project

  2. what is the purpose of splitting api,implementation modules into two modules instead of one module with two packages

Hi @Zorodebug5, sorry for the late replay. Thanks so much for the compliment. 🙂

  1. The logger was actually in the util module; I moved it out so I could experiment with a couple of things. I will probably move it back since it's simple and does not have much going on.
  2. Your question is totally valid. I admit, this is an overkill and could be simplified. I started with them being in a single module(common), but things were getting out of hand.

The whole idea of the API/Module implementation is this:

  • It makes experimenting with new/different technologies easier without needing to change a lot in other modules.

  • Better communication/sharing between modules. One "complex" feature is the show details. We need to get Show Information, Trailer Information, Season Information, etc. If you think about it, show-details module doesn't care about the implementation or dependencies. We just need to use the api modules to request data. To sum it up

    • api -> Describes the module on a high level . Eg, Gets me a list of shows.
    • implementaiton -> Contains all the implementation details, dependencies/libraries used.
  • Better dependency hierarchy & encapsulation. (Transitive dependencies can be a pain.)

  • Using Fixtures for testing: One huge thing that I like with this approach is I can easily create fixtures and use them in my tests instead of using mocks. So better tests. 😄 So if the implementation ever changes, we can catch anything that's broken with the tests.

  • It's not visible here, but when you scale, it helps with build speeds.

I wrote an article about it here. It will give you a glimpse of how. I got here.

I hope this answers your question. If not, feel free to ask.