I want to populate tranfer object i.e value object in DAO. I can do it two ways ,through constructor ,or through setter method. In Performance and memory use wise which is better approach in populating value object,using construtor or using setter method. Thanks In advance
Any difference is likely to be trivial, small enough to ignore. But if you needed to create a million objects in a nanosecond, and every bytecode counted, I'd go with the constructor, as you'd be able to avoid making a whole bunch of extra method calls.