Question

I am creating a mobile app that will connect to a zendamf implementation to retrive certain information to store and display to the user.

There are multiple php classes on the gateway to handle things like users, Orders, Products etc.

Therefore I would have a package called remotehandler with classes under it, remotehandler.orders remotehandler.product, remotehandler.users. Which would mean for each class I could do the following:

instead of creating a connection for each type of call I want to make lots of times I was thinking that it might be better to create a wrapper class for each call family I.E

Users

  • createUser - calls a php function to create the user
  • DeleteUser
  • UpdateUser

after some searching I came accross this post http://flexdevtips.blogspot.com/2009/05/using-flex-and-amfphp-without-services.html which shows how to deal with netconnection in code. but it is written if you are planning on making a single call.

Does anyone have any ideas or example on how I could turn this in to a class that would allow me to specific different source(php class functions).

Thanks

JaChNo

Was it helpful?

Solution

Simply expose a property on your Class (let's call it source) as a getter/setter pair that, when set, changes the source of the RemoteObject.

However, I find it is better to have a different Service Class for each return type I expect, because I can then mock the service and just drop in the mock when I am working on things that don't require a live connection to the database (such as skinning).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top