tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/713-any-complete-amfphp-exampleRobotlegs: Discussion 2012-01-05T13:10:03Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-13T08:00:02Z2011-11-13T08:00:02ZAny complete amfphp example?<div><p>I don't know of any examples, but there's really just one "rule"
you need to keep in mind when it comes to amfphp: all communication
with the back-end should happen through services. Commands pull
data from the models and pass them to the services that
subsequently call the appropriate remote services.<br>
There's one thing you need to keep an eye on (but this is also true
for non-RL projects):<br>
You should isolate the VO's you use for communication with the
back-end, and not use them as VO's in the rest of your system,
since any necessary modification to a VO structure used by the
backend will have it's impact on your front-end and vice versa.</p>
<p>I worked with amfphp for a pretty long time, but IMO it fails by
design, it tries to synchronise the frontend to the backend while
in my experience it's far more beneficial to have a translation
layer in between both.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-13T08:18:48Z2011-11-16T09:25:15ZAny complete amfphp example?<div><p>I’m using something similar to Joel’s <a href=
"https://github.com/joelhooks/robotlegs-examples-UnionPlatformChatClient">
https://github.com/joelhooks/robotlegs-examples-UnionPlatformChatCl...</a>
( a RemoteObjectFactory to set the remote object and channel)</p>
<ol>
<li>
<p>mapping LoginEvent to LoginCommand<br>
org.robotlegs.examples.bootstrap.controller.configuration.ConfigureCommandsCommand.as<br>
commandMap.mapEvent( LoginEvent.LOGIN, LoginCommand, LoginEvent
);</p>
</li>
<li>
<p>configuring a RemoteObjectFactory and mapping the service<br>
org.robotlegs.examples.bootstrap.controller.configuration.ConfigureServicesCommand.as</p>
</li>
<li>
<p><strong>RemoteObjectFactory</strong><br>
org.robotlegs.examples.bootstrap.service.factories.RemoteObjectFactory.as</p>
</li>
<li>
<p>Service<br>
org.robotlegs.examples.bootstrap.serviceUserService.as</p>
</li>
<li>
<p>using a command to call the service<br>
org.robotlegs.examples.bootstrap.controller.user.LoginCommand.as</p>
</li>
</ol>
<p>Now, if you are completely new to robotlegs that might look a
bit too complex at first. Reading the Best Practices document and
looking at some examples would help a lot.<br>
Best Practices: <a href=
"https://github.com/robotlegs/robotlegs-framework/wiki/best-practices">
https://github.com/robotlegs/robotlegs-framework/wiki/best-practices</a></p>
<p>Tutorials and examples:<br>
<a href=
"http://knowledge.robotlegs.org/discussions/examples/6-links-to-robotlegs-resources-examples-tutorials">
http://knowledge.robotlegs.org/discussions/examples/6-links-to-robo...</a></p>
<p>Joel’s Service Tutorial:<br>
<a href=
"http://www.developria.com/2010/06/an-introduction-to-robotlegs-a-2.html">
http://www.developria.com/2010/06/an-introduction-to-robotlegs-a-2....</a></p>
<p>I hope this helps to get you started with robotlegs and
Services. Come back with questions if you need more assistance
:)</p>
<p>Ondina</p>
<p>P.S. I see creynders answered your question while I was writing
this, but I'll post it anyway</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-13T17:08:08Z2011-11-13T17:08:10ZAny complete amfphp example?<div><p>Thank you for your long answer Ondina I will have a close look
at your links. Is the UnionChat example really using amfphp? I
didn't take the time to analyse the example in depth yet but from I
see there are no service-config.xml. I saw some AFMChannel stuff
though so I will have a look at how it's implemented.</p>
<p>Thank you creynders for the advices. I personnaly have
experience with building my own translation layer and it was such a
loss of time and hassle! I'd rather have it simpler for a start and
tweak it a little bit after if necessary. So far I'm pretty happy
of my experience using amfphp and that's why I would like to keep
going with it.</p></div>Migstag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-13T17:45:26Z2011-11-13T17:45:26ZAny complete amfphp example?<div><blockquote>
<p>So far I'm pretty happy of my experience using amfphp and that's
why I would like to keep going with it.</p>
</blockquote>
<p>Sure, was just my 2 cents. If you have any more specific
RL-amfphp questions just let me know!</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-13T23:51:39Z2011-11-13T23:51:39ZAny complete amfphp example?<div><p>Hi creynders, what would be your suggestions as an alternative
to AMFPHP (not necessarily requiring AMF as its protocol)? AMF has
its supporters and detractors in the Flex/Flash community it seems.
But having looked at the transmission speeds of JSON, for example,
AMF is not that much better. And with JSON, you could use all sorts
of RESTful services, I imagine. Curious to hear others' take on
Flash Remoting technologies of choice.</p>
<p>Migs, I think the above example that Ondina referred to
(UnionChat) is using WebOrb, which is an alternative to AMFPHP.</p></div>Timurtag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-14T08:43:31Z2011-11-14T08:43:31ZAny complete amfphp example?<div><p>@Timur: plain JSON can't be beaten IMO. It's fast, readable and
easily translatable. Most proxy, throttle, sniffer and debugger
clients can parse it so it's also easily debuggable. And developing
the translation layer only takes a little longer than creating the
back-end VO classes and making sure they synchronise correctly to
the front-end VO classes, but the translation layer requires less
time in maintenance and refactoring if something changes.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-15T00:37:35Z2011-11-15T00:37:35ZAny complete amfphp example?<div><p>@ creynders: thanks for your input. I agree about using JSON
over AMFPHP.</p></div>Timurtag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-19T17:58:37Z2011-11-19T17:58:39ZAny complete amfphp example?<div><p>Just wanted to let you know that I have successfully implemented
amfphp in a robotlegs project prototype :)</p>
<p>Thank you all for your help.</p></div>Migstag:robotlegs.tenderapp.com,2009-10-18:Comment/113634912011-11-21T09:19:54Z2011-11-21T09:19:54ZAny complete amfphp example?<div><p>You are welcome:)</p></div>Ondina D.F.