Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks Ryan, I think that makes sense. Let me ask a question to make sure I understand: I can use this approach and create the interface - in one impl I can call the third party api, in another impl I can call a test impl of the api so I can test in isolation. Is that correct? My concern is how I'm going to handle the methods in the API object when I have to call them (mostly set/get but there are some methods).
      singulars
    2. COYeh finding common ground is always tricky. Yes the interface describes what you app will use consistently across all implementations (classes using the interface or impl in java world). I tend to put only the common methods that are 'genericized' into the main interface. Then any specific api methods that are used by these methods in an implementation can do specific methods for the implementation. For instance here we have a matchup server and we call an interface for FindMatch(), StartMatch(), CloseMatch() etc. Those are in the interface. Then in a Gamecenter...
      singulars
    3. COimplementation of that class we use the GameCenter calls to get a match, start a match, close a match and have many other methods that those calls use specific to GameCenter as private methods. Then we can easily swap with a Test implementation that locally runs and also another matchup server that is self-hosted. So our three third party or unique uses are all commonized by the interface with generic calls. HTH Interfaces are also very common in web service server/client setups where all the code might not be on the client and only the interface and container classes need to be present.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload