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..
A Data-Transfer-Object (DTO) is used to exchange data between different parts of an application (such as different layers), or different applications.
Domain Objects (DO) (and the classes from which they are derived) implement business logic, as such they are only located in the Business logic layer / Domain (the essential meaning is the same even if the terms are different).
Because DO's implement business logic they can be complex, and can include methods, events and so on.
One more point about DTOs
According to the Martin Fowler school of thought a DTO is a combination of several objects (each of which would be what most people would commonly call a DTO); the rationale is that in situations it's less expensive to send larger packages of data less frequently (as opposed to being "chatty" and sending many small packages constantly across the wire).
So where most people would view a DTO as a single object Martin F is saying a DTO is simply an "envelop" that contains several discrete (and possibly unrelated) objects. Not a big issue IMO - most people take the view that a DTO is as per my definition at the top of this answer (or something close to it).