I have an existing microservice that talks to a Natural Language Processing (NLP) product and fetches around 50 fields. I need to create domain objects in Java now from these fields.
I read about builder pattern and read Effective Java. I understand builder pattern and using fluent approach is a good way to build objects, when we know some mandatory properties and have other optional properties.
In my case though, no fields are optional. I want to know what is the best practice to build objects in such a scenario.
I will have a wrapper MqObject which will be made of many user-defined domain objects, as shown below:
public class MqObject {
private UserDefinedClassA a;
private UserDefinedClassB b;
private UserDefinedClassC c;
private UserDefinedClassD d;
//getters and setters
}