Dependency Injection: Solution Walkthrough
The implementations for both the C# and Swift implementations are very similar; so I'm only intending to walk through the C# code.
I however will provide two zipped projects for download:
Code for each C# file will be posted inline with an explanation, but it may be simpler to just download the zip project file and follow along in Visual Studio.
The following dependencies are used for the C# solution:
The implementations for both the C# and Swift implementations are very similar; so I'm only intending to walk through the C# code.
I however will provide two zipped projects for download:
- C# Visual Studio project: using a simple singleton architecture for dependency injection. This project as mentioned previously only presents the output in the console; but is very easy to tie in with a View / ViewController.
- Swift Xcode project: this is very similar in design the C# codebase, except that it includes both a implementation for construction and the singleton style dependency architecture. It also includes a vrey rudimentary implementation of a View / ViewController using a macOS NSTableView. The split between the ctor and singleton code resides in the their respective Xcode playgrounds.
Code for each C# file will be posted inline with an explanation, but it may be simpler to just download the zip project file and follow along in Visual Studio.
The following dependencies are used for the C# solution:
- LanguageExt.Core (Functional Data Types. for example: Either)
- Newtonsoft.Json (Deserialisation of JSON encoding)
Last edited: