avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Map and Array Dependencies
Date Tue, 01 Oct 2002 08:26:05 GMT
Hi,

I have just added support for complex dependencies in Phoenix so that they can 
either be an array of services or a map of services. To declare an array you 
just postfix it with "[]" and to declare a map you postfix it with "#" in 
xinfo file. And then you can just access it via something like

void service( ServiceManager sm )
{
  //An array of services
  MyService[] services1 =
   (MyService[])sm.lookup( MyService[].class.getName() );

  //Same as above
  MyService[] services2 =
   (MyService[])sm.lookup( MyService.ROLE + "[]" );

  //A unmodifiable Map of services
  Map services3 =
   (Map)sm.lookup( MyService.ROLE + "#" );
}

It seems to work well. However I don't really like the idea of postfixing the 
service with "#" to indicate a map. I have thought about using "{}" instead 
or maybe "<>" - Any preferences?

Any other comments?

-- 
Cheers,

Peter Donald
The big mistake that men make is that when they turn thirteen or fourteen and
all of a sudden they've reached puberty, they believe that they like women.
Actually, you're just horny. It doesn't mean you like women any more at
twenty-one than you did at ten.                --Jules Feiffer (cartoonist) 


--
To unsubscribe, e-mail:   <mailto:avalon-phoenix-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-phoenix-dev-help@jakarta.apache.org>


Mime
View raw message