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" <[EMAIL PROTECTED]> 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
>


Reply via email to