Originally posted by Timothy Toe:
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.
Originally posted by Timothy Toe:
If yes, why do I need a StudentBO.java and then another StudentDTO.java....when they are so similar?
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.
Vaithiyanathan Sundaram<br />SCJP, SCBCD, SCEA part1
Originally posted by Vaithiya Sundaram:
No. Business Objects are NOT Value Objects and it will not have lot of getters and setters. BOs will use VO and applies business logic.
For example, in your case,
StudentDTO will have only attributes(like name,age,sex,etc) and, getters and setters for those attributes.
StudentBO will have/use StudentDTO to get/set student information and applies business logic methods like processStudentInfo(), determineEligiblity(), calculateAmountDue(), etc.
i.e. basically BOs are for applying business logic and results are stored in VOs and VOs are transferred to another tier or another BO's.
Hope it helps.
This would then basicly mean that you model both data and behaviour in the BODM and later on divide them (when needed) over different classes. In this case the TO will model the attributes of a student and the BO the business logic (behaviour) using the students data...
Originally posted by Timothy Toe:
Thanks for all the replies. They did help me understand better.
I just find it kind of weird � the fundamental understanding and design of Object Oriented Programming is to have (encapsulate) both attributes and behaviours in a single class�.but now I find that we are splitting them up into 2 classes � TO and BO.
[QB]
And� are TO and VO the same thing ? Both have attributes and getter/setter pair for each of its attributes and nothing more ?
/QB]
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |