Without knowing more details it is hard to respond. I did find the description of the relations between the DAO objects a bit "off" from what I would have expected. I would have expected something like:
CustomerDAO customerDAO = FactoryDAO.getCustomerDAO(); This assumes that the CustomerDAO is an interface and that getCustomerDAO() in FactoryDAO is setup to get the default implementation of the CustomerDAO. If CustomerSqlMapDAO is such an implementation, then I understand. The naming is just a bit odd to me. (I don't use iBatis and that may be standard terminology there.) With that small question in the back of my mind, this looks good. I would use the methods in the dispatch action to pass the detail work off to helper objects in the model. On Fri, 25 Feb 2005 23:43:10 +0000, Tim Christopher <[EMAIL PROTECTED]> 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] > > -- No one ever went blind looking at the bright side of life. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]