0

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

Gurneeraj Dahele 1 month ago updated by u11156342 2 weeks 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();