Every class needs to use DI for calling other classes, even though we’ll have anyway just a single implementation for all of them, and we won’t be using this flexibility at all (not even for tests where it might be useful for mocking dependencies).
Methods calling other methods? Heresy! There needs to be two or three interceptors on there, and some indirection over RabbitMQ using spring-integration, at the very least.
Hold on, I’m in the middle of drawing an inheritance graph so I know how Dog is related to AircraftCarrier.
public interface ICanTravelThroughTheAir { } public class Flea : ICanTravelThroughTheAir { } public class AircraftCarrier { private readonly List<ICanTravelThroughTheAir> _aircraft = new(); public void AddAircraft(ICanTravelThroughTheAir flyingThing) { _aircraft.Add(flyingThing); } } public class Dog : AircraftCarrier { public void Woof() { Console.WriteLine("Bitch I'm an aircraft carrier!"); } } public static class Program { public int Main(string[] args) { var dog = new Dog(); for (var i = 0; i < 10000; i++) { dog.AddAircraft(new Flea()); } dog.Woof(); } }Needs more
AbstractDefaultProxyBeanFactoryFactoriesAnd dependency injection!
Every class needs to use DI for calling other classes, even though we’ll have anyway just a single implementation for all of them, and we won’t be using this flexibility at all (not even for tests where it might be useful for mocking dependencies).
Methods calling other methods? Heresy! There needs to be two or three interceptors on there, and some indirection over RabbitMQ using spring-integration, at the very least.
This is how you write proper enterprise-level software: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
Not even unnecessarily templated, B- at best