Could you please explain the difference between Transfer objects and Domain objects in simple terms ? And if u could give a Java example, that would be great..
Transfer objects are often serializable due to the nature of its use, this is especially pertinent if the calls are remote and between JVM, or they will be used in a way that promotes serialization, such as stateful session beans. For this purpose, transfer objects must be susceptible to such "treatment", I.e. Transfer objects implement serializable.
The reverse may not be said of domain objects. Domain objects may contain behavior, however DTO are merely a transportation medium.