Strictly speaking no, because the ServiceLocator is part of the business layer, and this would introduce a dependency on a particular model from your business layer (you could imagine the business layer being useful to many distinct Flex apps with different models). That said the model changes the least out of the MVC players so in some situations where the model and service were very closely interdependent you could argue that this wasn't too great a loss.I have created a some what complicated services.as(EnterpriseServiceLocator) and I'm trying to give some limited controlback to the end user, and allow them to select from a list of availableAMFChannels. I almost have it all working, but have a couple ofquestions before I continue to finish the work in this area.
- Is it o.k for my Service Locator to access the Model locator?
- Is it o.k for my Service Locator to modify the values in the Model?
I'd queue the requests, going with the philosophy that like DAOs on the server you are trying to hide the complexity of how the services work from the rest of the application. As far as the command knows, it makes the asynchronous call and it just takes a while to come back while some tests are done. In fact something like this happens anyway when Flash tests for the appropriate cross domain file on the server before making an RPC call.- How would you best manage your application to "WAIT" until various
checks on the AMFChannels are done before doing anything further ?
- Would it be better to create an Event / Command to do the required
logic to determine the AMFChannels and then use this to set the Model,
then have the service locator access the Model for read only?
I'd add methods to the service to get lists of channel set names and select the channel - the rest of the app doesn't need to know that they're channel sets, just choices like "unsecure", "secure" or whatever you have.
- When the user selects an available AMFChannel, the system needs to
move the selected Channel to the TOP of the ChannelSet
- I'm doing this by creating an array of AMFChannels, storing these
in the Model, then reading them into the service locator and ChannelSet
when required.
- How do I ensure no further actions take place until this update is
done.
| ROBIN HILLIARD Chief Executive Officer robin@... RocketBoots Pty Ltd Level 11 189 Kent Street Sydney NSW 2001 Phone +61 2 9323 2507 Facsimile +61 2 9323 2501 Mobile +61 418 414 341 www.rocketboots.com.au | ||