• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Implementing Patterns

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! I am developing a struts based application.

I don't want to use EJB.
Using JDBC for connection. Using Connection Pooling.

For separating the business tier from the view tier, using an External Interface(BusinessDeligate class).
For all services, using ServiceImplementer classes. Saparating the data access using DAO.
BO to loosely couple the business objects.
ServiceImplementer classes can access BOs & DAOs.
We use DTO to separate view layer from business layer.

My question is:

Where to create the DTO & which classes mentioned above can access DTO?
Where to put the state of BO in to DTO?
Can we access the DTO in Jsp?

DTO - Data Transfer Object.
BO - Business Object.
DAO - Data Access Object.
DTO - Data Transfer Object.
Business Deligate - Service Facade.
Service Implementer - Application Service.

Please help!!
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, take a look at http://martinfowler.com/bliki/LocalDTO.html to decide whether you really should use DTOs at all.
 
john milr
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ilja!!

I think I have few reasons:

1) To separate the business layer & presentation layer.
2) Client should not interact directly with the components in Business tier & Integration tier.
3) Later on I want to implement ORM. Then I can use the BOs.
4) DTO can aggregate data from DAOs, Application Service & BOs.
5) I have no idea but I may need to update & upgrade my application more frequently, and perhaps need to implement load balancing & clustering.

I really need some guidance.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The data transfer objects would be created by the business objects. These objects are used by the presentation-oriented code (GUI) to display data.

Whatever has to be stored in the data transfer object is stored in variables of the DTO.

Yes, you can certainly access the data transfer objects in a Java Server page.





 
john milr
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you! James.

I have still some doubts:

In my view the ServiceImplementer classes should access DAOs & BOs.
By using those it should generate response, & the response is sent to Action & Jsp, using DTOs.
It means, it is ServiceImplementer classes which generate DTOs.

BOs should be implemented with the concept of loose coupling & tight cohesion.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It means, it is ServiceImplementer classes which generate DTOs.



If this object is creating data, then it should certainly create the data transfer objects.

If the business objects create data, then they should create the data transfer objects.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic