Java / Design Patterns
Explain Java beans pattern.
Using JavaBeans pattern, you call a parameterless constructor to create the object and then call setter methods to set each required parameter and each optional parameter of interest as required.
private Person person1= new Person(); person1.setFirstName("Steve"); person1.setLastName("Jobs"); person1.setDescription("Apple Founder");
This is an alternative to the telescopic constructor pattern. Java beans pattern allows inconsistency and mandates mutability which is a drawback.
More Related questions...