en
Kitaplar
Philipp Fehre

JavaScript Domain-Driven Design

  • b6693363393alıntı yaptı2 yıl önce
    stubbing out an external dependency.
  • b6693363393alıntı yaptı2 yıl önce
    Mock objects stand in for other objects in a system during testing, and sometimes even during development. There are multiple reasons to do this, for example, the underlying structure is not implemented yet, or the call would be really expensive both in a cost of time during development or even in money calling to an API that charges by the amount of calls.
  • b6693363393alıntı yaptı2 yıl önce
    The objects that enable this are called mocks; they are objects that provide a static implementation of a certain concept and can assert that they are called correctly. Mocks implement the protocol a certain object should follow.
  • b6693363393alıntı yaptı2 yıl önce
    Procedural code gets information then makes decisions. Object-oriented code tells objects to do things.
  • b6693363393alıntı yaptı2 yıl önce
    Declarative means the code tells objects what needs to be done and lets them handle the operations needed to achieve the goal
  • b6693363393alıntı yaptı2 yıl önce
    Often this is paraphrased in object-oriented language to say that a method should only have one dot.
  • b6693363393alıntı yaptı2 yıl önce
    Each unit should have only limited knowledge about other units: only units "closely" related to the current unit.
  • b6693363393alıntı yaptı2 yıl önce
    There have been many instances of, for example, SQL injection attacks because a model accessing the database reached directly for the data passed in an HTTP request without a layer to mitigate the access.
  • b6693363393alıntı yaptı2 yıl önce
    In our dungeon, having a dungeon master of a foreign dungeon communicate directly with a prisoner is also a bad idea, marking the prisoner as a spy and getting him killed immediately, most likely.
  • b6693363393alıntı yaptı2 yıl önce
    Reaching into different parts of an application without considering the appropriate APIs causes coupling two models together.
fb2epub
Dosyalarınızı sürükleyin ve bırakın (bir kerede en fazla 5 tane)