DTO == value object.
As far as adding "extra classes", why? The goal is to *reduce* unnecessary code . . .
Erik
Tim Christopher wrote:
Hi,
I'm currently designing a web application and as time progresses I keep on less convinced that my approach is correct.
Applying what I have to a shop example the classes I have are:
------------------------------------------------------ * Note: I use the iBATIS framework. ------------------------------------------------------ Customer.java # Contains get + set methods using correct types, ie. name (String), age (int), etc.
CustomerDAO.java # An interface for database operations for the Customer, i.e. insertCustomer, updateCustomer, etc.
CustomerSqlMapDAO.java # Implements the CustomerDAO interface and effectively calls the db.
CustomerService.java # Used to gain access to CustomerDAO and CustomerSqlMapDAO.
CustomerDispatchAction.java (ex insert method - but will contain CRUD) # Gets instance of CustomerService; copies jsp form details into a DynaActionForm; copy form DynaActionForm to Customer.java object; calls insert method in CustomerService with Customer object as the parameter; return ActionForward.
Struts-Config.xml # Contains DynaValidatorForm for storing customer details. ------------------------------------------------------ ------------------------------------------------------
I've tried looking through a few books and using Google for information that would explain if this is the correct approach, but all the tutorials I can find only show examples of projects that are very small.
I'm now at the stage in my project where I think I still have time to change the design if I do it in the next couple of days - otherwise I'm stuck with the approach I'm using above.
I think the closest I've come to finding anything is here: http://java.sun.com/blueprints/corej2eepatterns/Patterns/
... Though to be honest I don't really understand it.
Can someone take a look at my previous example and suggest any extra classes I should be using. Also it would be useful if you could let me know how the existing files link up to being: DAOs, DTOs, Value Objects (same of DTO?!), and business classes.
I think I'm a little confused! :os
Any help would be appreciated.
Tim Christopher
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]