Does database affect classes?
Posted
by
satyanarayana
on Stack Overflow
See other posts from Stack Overflow
or by satyanarayana
Published on 2014-05-31T09:04:38Z
Indexed on
2014/05/31
9:25 UTC
Read the original article
Hit count: 172
I had created one class User and UserDAOImpl class for querying DB using class User. As there is one table to be queried, these two classes are sufficient for me.
What if there is a case where new fields are to be added to that one table is to be divided into 3 tables( user_info, user_profile and user_address) to store user?
As new fields are added, I need to change classes User and UserDAOImpl, it seems these two are not sufficient. It seems database changes affect my classes.
In this case, do I need to divide class User into 3 classes as tables are changes? Can any one suggest me how can I solve this without making too many changes?
© Stack Overflow or respective owner