Bojan, thanks, very clear explanation !
I encouter this because I am confused how the
java bean design
pattern can be applied to inheritance, since the attributes are always "private" in a bean.
And I would like to inherite those common attributes from the super class , so that I do not need to write the "duplicate" setter / getter methods.
Here is my case:
I have a web application (
jsp,
servlet) that allow user
to insert, modify, delete a record in database with table
PRODUCT.
The table PRODUCT will present different type of products, video, audio and
book
[PRODUCT]
----------
id
name
----------
I will write VideoProduct.java, AudioProduct.java, BookProduct.java
to handle the insert, modify, delete business logic......
In the above case, I have to write the "SAME" getter and setter methods in all *.java.