Sir, you've just FAILED the company-mandated code review. What you SHOULD have done is noticed that HeadphonesForHotdogFactory is a SpringFramework Component, which is autowired into the HeadphonesForHotdogRepository, which is autowired into the HeadphonesForHotdogService, which is autowired into the HeadphonesForHotdogAdapter, which contains a method called CreateHeadphonesForHotdog() which will return your new instance of HotdogHeadphones.
View all comments
Show parent comment
28
u/JetSetWally Mar 16 '20
You need to create an instance of HeadphonesForHotdogFactory, and then call HeadphonesForHotdogFactory.CreateHeadphonesInstance();