creative way for implementing Data object with it's corespanding buisness logic class in java
- by ekeren
I have a class that need to be serialized (for both persistentcy and client-server communication)
for simplicity reasons lets call the classes Business a BusinessData and I prefix for their Interfaces.
All the getter and setter are delegated from Business class to BusinessData class.
I thought about implementing IBusinessData interface that will contain all the getter and setters and IBusiness interface that will extend it.
I can either make Business extend BuisnessData so I will not need to implement all getter and setter delegates, or make some abstract class ForwardingBusinessData that will only delegate getter and setters.
Any of the above option I loose my hierarchy freedom, does any of you have any creative solution for this problem...
I also reviewed DAO pattern: http://java.sun.com/blueprints/patterns/DAO.html