Hi Ben, Thanks for your reply. I will try what you've said (1 to 1 relation). I'm just thinking, if I create a new UserDelegate in a different Command, that will be a new Object so the services defined would be "freshly" instatiated as well. The old Objects called in my first command will be garbage collected. But it seems even creating the new object is still referencing the old one. I can see your point a one to one relationship between delegates & services, and that what I've seen a nearly all the examples on the net. But is it a necessity? The reason I'm doing it this way, is because the Business delegate I want it to be offering multiple tasks, so I want it to be a one point to look for doing calls to multiple service on the server-end.
Thanks Jairo --- In [email protected], "ben.clinkinbeard" <[EMAIL PROTECTED]> wrote: > > Not sure of your exact problem but you generally create a one to one > relationship between Delegates and Services. So you should probably > have UserDelegate, AdminDelegate and AuthorizationDelegate, with each > one mapping to the appropriate service. > > HTH, > Ben > > > --- In [email protected], "jairokan" <jairokan@> wrote: > > > > Hi, > > I'm using Cairngorm. On one of the Business Delegate classes, I got > > defined 3 services, instantiated on the Business delegate > > constructor. Here an example: > > class UserDelegate { > > > > private var userService: Object; > > private var adminService: Object; > > private var authorizationService: Object; > > private var responder : Responder; > > > > public function UserDelegate( responder : Responder ) { > > this.userService = ServiceLocator.getInstance().getService > > ( "UserService" ); > > this.adminService = ServiceLocator.getInstance().getService > > ( "AdminService" ); > > this.authorizationService = ServiceLocator.getInstance > > ().getService( "AuthorizationService" ); > > this.responder = responder; > > } > > > > } > > > > On one of my Cammand classes I create UserDelegate Object using new > > UserDelegate() this is supposed inturn to create the 3 services > > Object as seen in the code above. All is done I think, as expected. I > > call the Command object execute method, where I'm using ONE of the > > services in UserDelegate Object. Precisely I use > > authorizationService, and the behaviour is as expected. Then after > > using another Command instantiating the UserDelegate AGAIN, and using > > DIFFERENT service like userService, the reference is null. Because > > I'm creating a NEW UserDelegate so the service references souldn't be > > null. > > Can please please someone say where I got it wrong. > > > > Kind regards > > >

