Automatically generating ActionScript service classes?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatically generating ActionScript service classes?

David Wolever-4
Hey,
Has anyone tinkered around with automatically generating ActionScript,  
given a PyAMF gateway?

I ask because it's sort of annoying to keep my services in sync… And I  
get jealous when I see the Java and PHP guys click "import web  
service" and magically get all sorts of helpful code generated for them.
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Automatically generating ActionScript service classes?

Nick Joyce
Hi David!

The only project that I know of which attempts to do such a thing is http://code.google.com/p/pyamfcodegen/

I personally haven't used it but there is a nice screencast from the  
author at http://basaratali.blogspot.com/2009/02/python-actinscript-code-gen.html 
.

Hth,

Nick

On 14 Oct 2009, at 23:44, David Wolever wrote:

> Hey,
> Has anyone tinkered around with automatically generating  
> ActionScript, given a PyAMF gateway?
>
> I ask because it's sort of annoying to keep my services in sync… And  
> I get jealous when I see the Java and PHP guys click "import web  
> service" and magically get all sorts of helpful code generated for  
> them.
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Automatically generating ActionScript service classes?

Jesse Warden-2
In reply to this post by David Wolever-4
There is a big difference between a Service and a Business Delegate.  Do you just want a service where a class:
- can be instantiated, and 1 method makes the call, with parameters, in the order they appear in the Python equivalent method
- dispatch a success/error event for the result
- publicly expose the result

If that's acceptable, I can see how this would be nice to not only auto-gen the services, but then write FlexUnit4 tests for them as well to ensure they actually work out of the box.

...the only thing I find hard about the above is parsing .py files.  I could do it in AS3, but I suck in Python.

Anyway, I know a bunch of people have done this in Java & PHP; so I while I'd still build an abstraction layer on top of it, it would be a dope feature to have.  In order of priority, I'd vote for easier Django model integration like Nick or whoever discussed awhile ago... 

On Wed, Oct 14, 2009 at 6:44 PM, David Wolever <[hidden email]> wrote:
Hey,
Has anyone tinkered around with automatically generating ActionScript, given a PyAMF gateway?

I ask because it's sort of annoying to keep my services in sync… And I get jealous when I see the Java and PHP guys click "import web service" and magically get all sorts of helpful code generated for them.
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Automatically generating ActionScript service classes?

David Wolever-4
On 14-Oct-09, at 6:49 PM, Jesse Warden wrote:
> There is a big difference between a Service and a Business  
> Delegate.  Do you just want a service where a class:
> - can be instantiated, and 1 method makes the call, with parameters,  
> in the order they appear in the Python equivalent method
> - dispatch a success/error event for the result
> - publicly expose the result
> If that's acceptable, I can see how this would be nice to not only  
> auto-gen the services, but then write FlexUnit4 tests for them as  
> well to ensure they actually work out of the box.

Yup, that's what I'm thinking of.

> ...the only thing I find hard about the above is parsing .py files.  
> I could do it in AS3, but I suck in Python.

Well I know how to do all the .py introspection that will be required…  
So I think we'll be able to work something out ;)
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Automatically generating ActionScript service classes?

David Wolever-4
In reply to this post by Nick Joyce
On 14-Oct-09, at 6:48 PM, Nick Joyce wrote:
> The only project that I know of which attempts to do such a thing is http://code.google.com/p/pyamfcodegen/
> I personally haven't used it but there is a nice screencast from the  
> author at http://basaratali.blogspot.com/2009/02/python-actinscript-code-gen.html 
> .

Hhmm… It's a nice screenshot, and he's got some cool ideas (ie,  
storing session state), but I think (as we talked about on IRC), it's  
infeasible to use. He uses Python comments to declare types… Which  
means you've got to parse the .py files, instead of discovering them  
with introspection. That'd lead to brittle code and generally makes me  
very weary…
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users