Im not sure about approach to initialize and implement specific part of spring boot app.
I got e-commerce app that got Purchase class with fields (not sure whether its called field- eg "private String name;") and getters and setters. one of the field is shippingAddress address - own class with constructor with its fields.
My question is could I use:
Purchase purchase = context.getBean(Purchase.class);
purchase.setName("foo0");
purchase.setShippingAddress(new ShippingAddress("foo1", "foo2", "foo3"))
?(check last line). I mean, is going via "new" good approach? @Autowired annotation keeps popping into my mind but I think its not suitable here?