A couple of repeated lines does not sound too "clumsy" to me. I think you have the right separation of concerns with your current design.
Walden On Nov 18, 4:50 pm, str16star <[EMAIL PROTECTED]> wrote: > Thanks, your advise helped me solve the problem in 5 min. > > The code I was trying to call returns information about the user by > searching a database for a row with an id number that is set in the > session information and returning the data on that row. > > I've now put the search method in a class external to both Servlets, > so they can each call it (Never heard of a DAO before your message, so > thats my starter attempt). The only problem is that each time it's > called the method calling it has to get session information to pass to > it. Its only a couple of repeated lines in each servlet so I can live > with it but it's a little clumsy. > > Any suggestions? > > If not thanks again for the help. > > On Nov 18, 8:40 pm, walden <[EMAIL PROTECTED]> wrote: > > > > > Factor your server code. Service "Impls" are Servlets; you don't > > instantiate them. So take the parts that are needed by Chat (which > > are probably data access methods, right?), factor those out into a DAO > > object (not a Servlet), and call that from both "impls". > > > On Nov 18, 7:46 am, str16star <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > I'm just getting started with gwt and java, so this is probably quite > > > a simple question. > > > > I am building an app that has an RPC service called UserManagement so > > > the server side code is in UserManagementImpl > > > > I also have an RPC service called Chat. The ChatImpl class needs to > > > call methods from UserManagementImpl but any instances I try to create > > > of UserManagementImpl are always null. > > > > I'm using the following line of code in ChatImpl: > > > UserManagementImpl user = new UserManagementImpl(); > > > > I've tried it with an empty constructor method for UserManagmentImpl > > > and without. > > > > I can post more code if required. > > > > Any help appreciated.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
