Business Objects(BOs) & Data Transfer Objects(DTOs)-both needed ?

In a J2EE system...

I know that "Business Objects" (BOs) are basically value objects (VOs) ...lots of getters and setters and some business logic. These are basically to model nouns in the system. Eg Student BO.

I know that "Data Transfer Objects" (DTOs) are value objects (VOs)....with getters and setters... with the purpose of avoiding multiple method calls...to avoid overhead...which effects performance. eg it's better to pass a Student DTO then say...pass the student ID and student name and student age etc etc.

Main question : Should a system have both ? If yes, why do I need a StudentBO.java and then another StudentDTO.java....when they are so similar ?...when both are basically VOs ? Can't I just use BOs to serve as DTOs ?

Thanks.

[778 byte] By [bw_ta] at [2007-10-2 5:32:10]
# 1

Hi,

I've started using BO's and DTO's since 3 months .With my experiece i understand we nned both of them.

The BusinessObject represents the data client. It is the object that requires access to the data source to obtain and store data.

DTO

This represents a Transfer Object used as a data carrier. The DataAccessObject may use a Transfer Object to return data to the client. The DataAccessObject may also receive the data from the client in a Transfer Object to update the data in the data source.

From this i want to tell you that We are not gonna do any operation on BO's but we do operations on DTO

Ashwin

ashkuma at 2007-7-16 1:43:04 > top of Java-index,Other Topics,Patterns & OO Design...