views:

2223

answers:

2

I am a AS3 novice learning PureMVC and want to write code following best practices so that any other AS3 developer can pick up my code and easily understand what I did, I am tempted to do stuff as I would in JavaScript or Asp.Net/C#, but I have a feeling that might not be the best approach.

Thoughts? Links?

+1  A: 

I found that reading through the docs helped me get a clear definition of each of the parts to PureMVC. On top of that I downloaded the source for the demos and added them in Flex Builder so I could look through them easily and see how they were constructed to get an idea of how I should construct my project.

One thing you have to remember is that you can do things any way you want, but to make using the framework worthwhile you should stick to the structure and way of doing things that it suggests. For example you could give your view a reference to the facade and have it get information from Proxies etc. But you should keep the view decoupled from the framework and just have it dispatch events and have a Mediator deal with the facade.

Max Stewart
+2  A: 
  1. Using reverse domain folder structure is common from the Flex code I have seen. ie: com/mydomain/myproject/view ... model, business, controller (this would make it easy for me to understand your code) More: http://blog.tsclausing.com/post/11

  2. ASDoc is a tool that creates very pretty HTML documentation from code comments automatically: http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=asdoc_127_1.html

  3. You may be beyond this point but I have used Cairngorm (MVC) and it was well documented: http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm

Code Example This is the Cairngorm store which is the standard Cairngorm example: http://cairngormdocs.org/blog/?p=17

Brandon