0

How can we design a class/method where we instantiate a long entity object?

Gurneeraj Dahele 4 years ago updated by 3 years ago 1

How can we design a class/method where we instantiate a long entity object? Size of method will become very long. Can we pass entity as parameter to private methods and setting related values in each private method. Is this good approach?

Have you looked at the builder pattern perhaps? 

Google for java builder examples, but youll have something like MyClass.builder().setProperty1().setProperty2().build();