[flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore?
Hi Ben,Samuel and others... After struggling with the ServiceLocator for a whole day I found this thread that gave me some insight to the problem. I wonder if anyone can post improved SerivceLocator class here that includes an initServices method. Since I'm not a big fan of changing a precompiled lib code I want to try and do this in the Services.mxml class that extends the ServiceLocator. I would think Adobe will find a better solution than that for this problem but this will work nicely for me now. --- In flexcoders@yahoogroups.com, ben.clinkinbeard [EMAIL PROTECTED] wrote: That phrase causes me to imagine you are religious? Not even a little bit :)
Re: [flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore?
On Thursday 16 November 2006 04:03, ben.clinkinbeard wrote: The external xml file I spoke of is a config file for the whole app Wait, are you telling me there isn't a 'FlexSpring' already :-) -- Tom Chiverton, this post has been an in-joke for people who've heard of Spring or ColdSpring This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore?
I'm not trying to spar with you Ben. This discussion has been beneficial to myself and others who have read it, but it is degrading. So, I would like to add more clarity to my statements because it appears that there are some misunderstandings. Perhaps because I did not articulate myself fully? Altering a core class in a widely used framework and building your apps to rely on that non-standard behavior is simpler? How so? First Cairngorm 2.1 is still in beta, so I wouldn't consider it widely used or a standard yet. Secondly, it isn't that hard to add a few lines of code to a class and recompile it; that is a pretty common task. In *context* to what I was proclaiming is that it is simpler for the ServiceLocator to make the call to loadWSDL internally INSTEAD of the client making that call and keeping track of how many times that call has been invoked. I have posted this recommendation on the Cairngorm discussion in hopes that it get's put in version 2.1. It would make it a more seamless change from Cairngorm 2.0 to 2.1 if they do add the call to loadWSDL in the ServiceLocator itself. Again, how so? Loading a handful of text files during app startup is not exactly what I would call a performance penalty. Performance hit then. :) Think of it as I just need one record in the database, but I will select all of them. Logically, selecting all records in a database when only one is required would be superfluous. Loading all the WSDLs is superfluous also. Additionally, why are you storing your web services in an xml file? I store mine in a Services.mxml file as suggested. Is there any benefit to be gained from that? How does the ServiceLocator know to look at the xml file? Are you inheriting from the ServiceLocator with special logic to extract the services from that xml file? If you are, that seems unnecessary. The ServiceLocator was designed to read from the Services.mxml, right? Has that changed with version 2.1? Where is that documented? -Bruce From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Wednesday, November 15, 2006 12:35 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore? The ServiceLocator should invoke that method, it's simpler that way. Altering a core class in a widely used framework and building your apps to rely on that non-standard behavior is simpler? How so? Your application will endure performance penalties from that. Again, how so? Loading a handful of text files during app startup is not exactly what I would call a performance penalty. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Leggett, Samuel B CTR NETPDTC, N634 [EMAIL PROTECTED] wrote: When you call getWebService(), you are calling it through your subclass of ServiceLocator. That is true; however, your subclass should not need to call loadWSDL. The ServiceLocator should invoke that method, it's simpler that way. As far as needing to iterate over all of the services, I suppose that is true in some cases, but is that really a big deal? I would argue its not. That's ok. Your application will endure performance penalties from that. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of ben.clinkinbeard Sent: Tuesday, November 14, 2006 10:59 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore? Hi Bruce, loadWSDL() is an asynchronous call, so you would need to implement a listener to determine when the wsdl has been loaded, and only then return from the getWebService() method. As far as needing to iterate over all of the services, I suppose that is true in some cases, but is that really a big deal? I would argue its not. Personally, I have an xml config file where I store all references to remote services, so getting a list of web services is a simple E4X expression. When you call getWebService(), you are calling it through your subclass of ServiceLocator. Its an inherited method, yes, but you're calling it through MyAppServices or whatever you name it. HTH, Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Leggett, Samuel B CTR NETPDTC, N634 samuel.leggett.ctr@ wrote: I agree with you Ben except it seems superfluous to try and load all of the WSDLs upon creation of the ServiceLocator. Doing it that way means you have to iterate all the services of the ServiceLocator including RemoteObjects. I also don't believe that the loadWSDL() call belongs in a subclass of ServiceLocator either; it is the responsibility of the ServiceLocator
[flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore?
I subclass ServiceLocator with an AS class rather than an MXML file. In that class I declare the service variables, set some properties on them (I usually set makeObjectsBindable to false), and in the initServices() function call loadWSDL() on each of them. The external xml file I spoke of is a config file for the whole app that holds any number of settings that may need to be adjusted. The items of interest to this discussion are the WSDL urls, and this is done to facilitate using the same swf in different environments (dev, integration, production, etc). So when my app starts up I load and parse the config file, store it in the model, and then select (via E4X) and load the WSDLs. Then I move on to whatever actions the app needs to perform. I suppose your analogy of selecting rows from a db does hold true in some cases. If your app deals with a large number of services or there is a possibility that you may not use some services then yes, my approach may be inappropriate. However, the app I am currently working on (and most I can think of) only deal with a handful of services (= 5) and I know they will all be used, so doing the loading up front makes sense. To each his own. Ben --- In flexcoders@yahoogroups.com, Leggett, Samuel B CTR NETPDTC, N634 [EMAIL PROTECTED] wrote: I'm not trying to spar with you Ben. This discussion has been beneficial to myself and others who have read it, but it is degrading. So, I would like to add more clarity to my statements because it appears that there are some misunderstandings. Perhaps because I did not articulate myself fully? Altering a core class in a widely used framework and building your apps to rely on that non-standard behavior is simpler? How so? First Cairngorm 2.1 is still in beta, so I wouldn't consider it widely used or a standard yet. Secondly, it isn't that hard to add a few lines of code to a class and recompile it; that is a pretty common task. In *context* to what I was proclaiming is that it is simpler for the ServiceLocator to make the call to loadWSDL internally INSTEAD of the client making that call and keeping track of how many times that call has been invoked. I have posted this recommendation on the Cairngorm discussion in hopes that it get's put in version 2.1. It would make it a more seamless change from Cairngorm 2.0 to 2.1 if they do add the call to loadWSDL in the ServiceLocator itself. Again, how so? Loading a handful of text files during app startup is not exactly what I would call a performance penalty. Performance hit then. :) Think of it as I just need one record in the database, but I will select all of them. Logically, selecting all records in a database when only one is required would be superfluous. Loading all the WSDLs is superfluous also. Additionally, why are you storing your web services in an xml file? I store mine in a Services.mxml file as suggested. Is there any benefit to be gained from that? How does the ServiceLocator know to look at the xml file? Are you inheriting from the ServiceLocator with special logic to extract the services from that xml file? If you are, that seems unnecessary. The ServiceLocator was designed to read from the Services.mxml, right? Has that changed with version 2.1? Where is that documented? -Bruce From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Wednesday, November 15, 2006 12:35 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cairngorm 2.1 why the ServiceLocator dosen't extends UIComponent anymore? The ServiceLocator should invoke that method, it's simpler that way. Altering a core class in a widely used framework and building your apps to rely on that non-standard behavior is simpler? How so? Your application will endure performance penalties from that. Again, how so? Loading a handful of text files during app startup is not exactly what I would call a performance penalty. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Leggett, Samuel B CTR NETPDTC, N634 samuel.leggett.ctr@ wrote: When you call getWebService(), you are calling it through your subclass of ServiceLocator. That is true; however, your subclass should not need to call loadWSDL. The ServiceLocator should invoke that method, it's simpler that way. As far as needing to iterate over all of the services, I suppose that is true in some cases, but is that really a big deal? I would argue its not. That's ok. Your application will endure performance penalties from that. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of ben.clinkinbeard Sent: Tuesday, November 14, 2006 10:59 To: flexcoders@yahoogroups.com