Good question. You can never rule out the possibility of one day using a different Session class but the rest of your code will be expecting the Session to have certain methods. Creating an interface just creates a contract so that no matter which concrete Session class you use, it will always have to adhere to that contract. Hope that makes sense 🤔
Next level of positivity - finishing every section with "Great stuff!" :) How cool is that?! :D
I know, right!? 😂
Love the videos Gary
Great tutorial, just a question though, why use an interface when there's only ever going to be one class implementing it?
Good question. You can never rule out the possibility of one day using a different Session class but the rest of your code will be expecting the Session to have certain methods. Creating an interface just creates a contract so that no matter which concrete Session class you use, it will always have to adhere to that contract.
Hope that makes sense 🤔
@@GaryClarkeTech Yeah makes sense, thanks
👍👍👍