Re: [flexcoders] AIR Cairngorm Application Command Architecture

2008-11-19 Thread Robin Hilliard

On 19/11/2008, at 9:59 AM, zwigby wrote:


So I was thinking of each calculation being a command and
then the steps would be helper classes that use delegates to get the
information from local database. Any thoughts would be great. Thanks
in advance.



Hi Zwigby,

All your calculation helpers and data access delegates are part of  
your business package (not everything in business has to be a remote  
service delegate - it's also home to filters, validators, formatters  
and the kind of helper utilities you describe).  As you suggest you  
would instantiate and call these business classes from a command*.


When in doubt, my rule of thumb is to strictly think of a command  
being responsible for co-ordinating responses to a single user action,  
so if there was one act to kick off the calculations I would write one  
command and get it to run all the calculations, even going to the  
extent of making multiple asynchronous calls if necessary or writing a  
little state machine to keep track of things - this is when having  
command logic in it's own class gives you the elbow room to do more  
complex stuff.  BTW commands don't have to implement IResponder if  
they aren't calling asynchronous methods.


HTH,
Robin

*or occasionally directly from the view, if what you're doing isn't  
changing the model.  Think of the way the Flex SDK validators and  
formatters are used in views all the time - they are really business  
classes helping the view out.  Dependency and isolation-wise the  
important bit is that they themselves don't know they're helping the  
view.



ROBIN HILLIARD
Chief Executive Officer
[EMAIL PROTECTED]

RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia
Phone +61 2 9323 2507
Facsimile +61 2 9323 2501
Mobile +61 418 414 341
www.rocketboots.com.au  





Re: [flexcoders] Re: Cairngorm | Multiple Modules | Only one Service Locator instance instantiated

2008-11-19 Thread Robin Hilliard

Hi ilikeflex,

Multiple Controllers are ok (you just instantiate the module's  
controller somewhere when it loads) but ServiceLocators are singletons  
in Cairngorm, so perhaps a better approach would be to add additional  
services to the existing instance when you load a module, using (for  
example) ServiceLocator.getInstance().getRemoteObjects().someService  
= ...


On 20/11/2008, at 11:11 AM, dev.apostiglioni wrote:

For an alternative to Cairngorm that supports modular applications,
you can have a look to http://code.google.com/p/aconcagua-flex/


I know you answered the question well, and yet I'm still looking  
forward to the day I see a normal response to a Cairngorm question on  
this list that doesn't plug another framework. :-)


Robin


ROBIN HILLIARD
Chief Executive Officer
[EMAIL PROTECTED]

RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia
Phone +61 2 9323 2507
Facsimile +61 2 9323 2501
Mobile +61 418 414 341
www.rocketboots.com.au  






Re: [flexcoders] Re: Cairngorm for AS3 projects?

2008-11-18 Thread Robin Hilliard

On 18/11/2008, at 1:10 PM, dev.apostiglioni wrote:

With regards to Cairngorm it removes all the
problems you have with tight coupling etc.


Hi Dev and everyone,

Our company has developed tens of commercial projects with Cairngorm  
over the last four or so years including several with hundreds of  
classes in the client, in Flex and Flash.  I have to admit that I  
simply don't understand many of the criticisms levelled at Cairngorm  
on this list.  It is a very small amount of code (only a few hundred  
lines without comments and spaces) to be responsible for so much  
misery ;-).  If people can give me some specific examples of tight  
coupling or other problems they are having with Cairngorm I would be  
happy to spend some time over the next few weeks (while my workload is  
lighter) suggesting ways to address them.


Regards,
Robin


ROBIN HILLIARD
Chief Executive Officer
[EMAIL PROTECTED]

RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia
Phone +61 2 9323 2507
Facsimile +61 2 9323 2501
Mobile +61 418 414 341
www.rocketboots.com.au  






Re: [flexcoders] Cairngorm for AS3 projects?

2008-11-13 Thread Robin Hilliard

Hi Rick,

In the past we developed several AS2 Flash (not Flex) applications in  
Cairngorm. In the current version of of Cairngorm almost all of the  
dependencies on mx packages are in the ServiceLocator, which used not  
to be the case with earlier Cairngorm versions. You can roll your own  
old style ServiceLocator using the singleton code from the comments in  
IModelLocator (maybe also make the class dynamic).


The only other thing you'll miss is bindings, which are God's gift to  
MVC developers although somehow they seem to be something the other  
Flex frameworks try to avoid using for some reason I fail to fathom...  
oops I'm ranting.  Anyway without binding the ViewHelper pattern can  
help - this also used to be part of Cairngorm, although now deprecated.


Here's an old blog post of ours with an example of Cairngorm (I think  
0.99) in a Flash project:


http://www.rocketboots.com/blog/index.cfm?mode=entryentry=83219052-E081-51EF-A73B5F4EF642C3F5

Cheers,
Robin


ROBIN HILLIARD
Chief Executive Officer
[EMAIL PROTECTED]

RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia
Phone +61 2 9323 2507
Facsimile +61 2 9323 2501
Mobile +61 418 414 341
www.rocketboots.com.au  



On 14/11/2008, at 12:03 AM, Rick Schmitty wrote:


Is there any reason not to use cairngorm for AS3 projects. I know
cairngorm uses classes in the mx.* range so its using some flex
framework code (and I assume that means adding the 126kb framework
code at least..)

is there a framework AS3 projects use instead?

thanks


[flexcoders] MXML, visual/non-visual classes and the id property

2008-04-21 Thread Robin Hilliard

Hello all,

Just wondering, does anyone know what magic the MXML compiler uses to  
decide that visual classes declared in MXML get their id properties  
recorded in component descriptors and set when instantiated, whilst  
non-visual classes get an empty string if they have an id property?  I  
was looking around for some metadata in the core classes that might do  
the trick with no success.


Thanks,
Robin



ROBIN HILLIARD
Chief Executive Officer
[EMAIL PROTECTED]

RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia
Phone +61 2 9323 2507
Facsimile +61 2 9323 2501
Mobile +61 418 414 341
www.rocketboots.com.au  





Re: [flexcoders] How to do equivalent of makeObjectsBindable=false on mx:Consumer

2007-12-12 Thread Robin Hilliard
For everyone's information here's a quick recursive function I wrote  
as a hack to strip out collections for now:


private function stripCollections(o : *) : * {
var k : String;
if (o is Array) {
for (k in o)
o[k] = stripCollections(o[k]);
} else if (o is ArrayCollection) {
return stripCollections(o.source);
} else if (o is Object) {
for (k in o)
o[k] = stripCollections(o[k]);  
}
return o;
}

Cheers,
Robin



Robin Hilliard

CEO - RocketBoots Pty Limited
Consulting . Recruitment . Software Licensing . Training
http://www.rocketboots.com.au

switch+61 (0)2 9323 2500
fax   +61 (0)2 9323 2501
direct+61 (0)2 9323 2507
mobile+61 (0)418 414 341
email [EMAIL PROTECTED]


On 12/12/2007, at 4:05 PM, Robin Hilliard wrote:


Hi Pete, nice to hear from you :-)


Tried that out but it didn't seem to have any effect - the  
collections were still wrapped.  Isn't that setting more to do with  
AMF 1/2/3 - wouldn't the array collection wrapping take place  
inside the mx.messaging client code?


Cheers,
Robin



Robin Hilliard


On 12/12/2007, at 1:00 PM, Peter Farland wrote:



You can try setting the following property in your services- 
config.xml channel-definition(s):


...
properties
serialization
legacy-collectiontrue/legacy-collection
/serialization
/properties
...

Note that properties that are returned as normal Arrays will not  
detect property change events and will not be bindable or managed.


Pete


Re: [flexcoders] How to do equivalent of makeObjectsBindable=false on mx:Consumer

2007-12-12 Thread Robin Hilliard
Ok, thanks for that - here's the relevant bit from log entry where  
the message is being serialised:


  aTest = (Externalizable Object #4  
'flex.messaging.io.ArrayCollection')

(Array #5)
  [0] = Hello from an array

So according to the ActionMessageInput docco this will become an  
ArrayCollection on the client.  I am writing a ColdFusion array into  
the message body which is being converted to a  
flex.messaging.io.ArrayCollection - if I can convert the CF array  
into a native Java array then according to the same docco it should  
become a plain array on the client.  Will let you know how I go.


Thanks,
Robin


Robin Hilliard

CEO - RocketBoots Pty Limited
Consulting . Recruitment . Software Licensing . Training
http://www.rocketboots.com.au

switch+61 (0)2 9323 2500
fax   +61 (0)2 9323 2501
direct+61 (0)2 9323 2507
mobile+61 (0)418 414 341
email [EMAIL PROTECTED]


On 13/12/2007, at 2:03 AM, Peter Farland wrote:


Hey Robin,

 Tried that out but it didn't seem to have any
 effect - the collections were still wrapped.
 Isn't that setting more to do with AMF 1/2/3
 - wouldn't the array collection wrapping take
 place inside the mx.messaging client code?

What client Channel and server Endpoint are you using? What messaging
service adapter are you using?

As far as I know client Consumers do not do any wrapping. You  
should be
able to turn on Debug level logging for the Endpoint.* category in  
your

/WEB-INF/services-config.xml, restart your application, and watch the
console log to see what AMF type is being sent for your AsyncMessage
body property (assuming that it's this property that you don't want to
be wrapped).

I suspect something on the server is returning a collection type  
that is

perhaps being special cased because it is Externalizable.


Re: [flexcoders] How to do equivalent of makeObjectsBindable=false on mx:Consumer

2007-12-12 Thread Robin Hilliard
FYI using toArray() on the ColdFusion array worked perfectly (thanks  
Mr Mandel):


aTest = (Array #4)
[0] = Hello from an array

Cheers,
Robin




On 13/12/2007, at 10:06 AM, Robin Hilliard wrote:

Ok, thanks for that - here's the relevant bit from log entry where  
the message is being serialised:



  aTest = (Externalizable Object #4  
'flex.messaging.io.ArrayCollection')

(Array #5)
  [0] = Hello from an array

So according to the ActionMessageInput docco this will become an  
ArrayCollection on the client.  I am writing a ColdFusion array  
into the message body which is being converted to a  
flex.messaging.io.ArrayCollection - if I can convert the CF array  
into a native Java array then according to the same docco it should  
become a plain array on the client.  Will let you know how I go.


Thanks,
Robin


Robin Hilliard

CEO - RocketBoots Pty Limited
Consulting . Recruitment . Software Licensing . Training
http://www.rocketboots.com.au

switch+61 (0)2 9323 2500
fax   +61 (0)2 9323 2501
direct+61 (0)2 9323 2507
mobile+61 (0)418 414 341
email [EMAIL PROTECTED]


On 13/12/2007, at 2:03 AM, Peter Farland wrote:


Hey Robin,

 Tried that out but it didn't seem to have any
 effect - the collections were still wrapped.
 Isn't that setting more to do with AMF 1/2/3
 - wouldn't the array collection wrapping take
 place inside the mx.messaging client code?

What client Channel and server Endpoint are you using? What messaging
service adapter are you using?





[flexcoders] How to do equivalent of makeObjectsBindable=false on mx:Consumer

2007-12-11 Thread Robin Hilliard

Hi All,

Just trying to avoid having arrays in my message bodies wrapped as  
ArrayCollections (because I am trying to pass them out through  
ExternalInterface.call() as normal arrays).  makeObjectsBindable  
seems to only apply to RPC services, any ideas on the messaging side?


Thanks,
Robin





Robin Hilliard

CEO - RocketBoots Pty Limited
Consulting . Recruitment . Software Licensing . Training
http://www.rocketboots.com.au

switch+61 (0)2 9323 2500
fax   +61 (0)2 9323 2501
direct+61 (0)2 9323 2507
mobile+61 (0)418 414 341
email [EMAIL PROTECTED]




Re: [flexcoders] How to do equivalent of makeObjectsBindable=false on mx:Consumer

2007-12-11 Thread Robin Hilliard

Hi Pete, nice to hear from you :-)

Tried that out but it didn't seem to have any effect - the  
collections were still wrapped.  Isn't that setting more to do with  
AMF 1/2/3 - wouldn't the array collection wrapping take place inside  
the mx.messaging client code?


Cheers,
Robin



Robin Hilliard


On 12/12/2007, at 1:00 PM, Peter Farland wrote:



You can try setting the following property in your services- 
config.xml channel-definition(s):


...
properties
serialization
legacy-collectiontrue/legacy-collection
/serialization
/properties
...

Note that properties that are returned as normal Arrays will not  
detect property change events and will not be bindable or managed.


Pete


[flexcoders] mx:SetProperty with value=@Resource... coercion error?

2006-07-23 Thread Robin Hilliard


Just wondering if anyone else is using states with localisation.  I get the error:"Implicit coercion of a value of type String to an unrelated type Number"although according to the docs, value is typed *.  Anyone got any ideas?Cheers,Robin __Robin HilliardDirector - RocketBoots Pty LtdConsulting . Software Licensing . Recruitment . Traininghttp://www.rocketboots.com.auFor schedule/availability call Pamela Higgins:w    +61 7 5451 0362m    +61 419 677 151f    +61 3 9923 6261e    [EMAIL PROTECTED]or Direct:m    +61 418 414 341e    [EMAIL PROTECTED] *** Worldwide Adobe Licensing - Volume discounts now start at one point *** 
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___


Re: [flexcoders] Re: Cairngorm Question

2006-01-17 Thread Robin Hilliard
Hi YJ,

Sure - the Cairngorm code is unmodified.  For instance, in your view  
you might have:


private var viewHelper : OurViewHelper;
private var searchDefinition : SearchDefinitionVO;
...
EventBroadcaster.getInstance().broadcastEvent 
(OurController.SEARCH_COMMAND,
{viewHelper:viewHelper, searchDefinition:searchDefinition});


And in the command:


private var cachedViewHelper : OurViewHelper;

function execute(event : Event) : Void {
cachedViewHelper = event.data.viewHelper;
delegate.search(event.data.searchDefinition);
}

public function onResult(event : Object) : Void {
cachedViewHelper.showSearchResult(SearchResultCollectionVO 
(event.result));
}

There is a bit more to talk about regarding the initial creation of  
the view helpers and views which I hope to blog soon, but if you have  
more specific questions fire away.

Cheers,
Robin

__

Robin Hilliard
Director - RocketBoots Pty Ltd
Professional Services for Macromedia Technologies
http://www.rocketboots.com.au

For schedule/availability call Pamela Higgins:
w+61 7 5451 0362
m+61 419 677 151
e[EMAIL PROTECTED]

or Direct:
m+61 418 414 341
f+61 2 9798 0070
e[EMAIL PROTECTED]

  *** Register for WebDU http://www.mxdu.com 2-3 March 2006 ***


On 18/01/2006, at 5:50 AM, fowleryj wrote:

 Hi Robin,

 Your application appears very organized and well thought-out. One
 question: If workspace instance X broadcasts an event, and workspace
 instance Y is also open (in this example, let's say that both X and Y
 are instances of the search screen, and X just broadcasted a search
 event), would workspace instance Y respond to the information
 returned from the search? Are you using the EventBroadcaster exactly
 as it exists in Cairngorm?

 Thanks,
 YJ



--
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/

* 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] Cairngorm Question

2006-01-16 Thread Robin Hilliard
Hi YJ,

RocketBoots is working with a development team on a large (100s of  
classes) Flex 1.5 Cairngorm application at the moment with  
potentially many instances of the same sub-application (we call  
them workspaces) around at the same time - e.g. two searches, three  
articles, a calculator etc.

Here's our solution, which is working nicely.  Each type of workspace  
has it's own viewHelper class.  Each workspace instance has it's own  
viewHelper instance.  Because there are multiple instances it was  
going to be difficult to use the ViewLocator and ModelLocator, so we  
didn't.  Instead, when workspace instance X broadcasts an event, we  
include a reference to the workspace's viewHelper in the event data.   
The command's execute method caches this viewHelper in an instance  
variable, and its onResult method uses the same viewHelper to display  
the results.  The viewHelper instance also holds our model, using  
instance instead of static variables (although we can imagine using  
statics in some situations, for bits of the model shared across all  
workspaces).

Happy to answer further questions about this approach - this one has  
been in the backlog of things to blog for a while.

Cheers,
Robin

__

Robin Hilliard
Director - RocketBoots Pty Ltd
Professional Services for Macromedia Technologies
http://www.rocketboots.com.au

For schedule/availability call Pamela Higgins:
w+61 7 5451 0362
m+61 419 677 151
e[EMAIL PROTECTED]

or Direct:
m+61 418 414 341
f+61 2 9798 0070
e[EMAIL PROTECTED]

  *** Register for WebDU http://www.mxdu.com 2-3 March 2006 ***


On 17/01/2006, at 1:37 AM, fowleryj wrote:

 We have been developing a fairly large application using Flex 1.5 and
 the Cairngorm framework, and have recently run across what could be a
 large roadblock. Our application has many sub-applications the user
 can choose to run from a menu in the main application. To implement
 this we are dynamically creating the children the user selects in a
 view stack. All of these sub-applications rely on a particular search
 screen that allows the user to find a particular person in our
 database. The problem is that the sub-applications are bound to the
 selection the user makes in the search screen, and are all reacting to
 the same events (which are broadcast from the search screen). We would
 like the search screens to function as separate instances. For
 example, if I broadcast a change event from the search screen, all of
 the open sub-applications will catch the event and change all of their
 displayed information to reflect that of the most recently selected
 person. Our problem appears to stem from the way the EventBroadcaster
 and FrontController are designed. All events are broadcast in the same
 EventBroadcaster using the getInstance() method, thus everything is
 listening for everything.

 Can anyone who is familiar with the intricacies of Cairngorm propose a
 way to deal with this problem? We would like to be able to return the
 information about the selected person only to the sub-application that
 invoked the search screen. Perhaps it is not possible to do this using
 Cairngorm, and we would appreciate knowing that, too.

 If anyone has a different/better solution, we'd love to hear about it.

 Thanks in advance.




--
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/

* 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/
 




[flexcoders] Background movieclip of mx:Label?

2006-01-15 Thread Robin Hilliard
Hi All,

Just wondering, has anyone worked out how to access the opaque box  
that appears in the background of mx:Label?  I'm trying to hide it so  
that (in this once off special case) I can pack labels closer  
together without new labels obscuring previous labels.  The box clip  
is separate to the actual TextField instance (labelField) in the  
label, but I can't spot it even with ASSetPropFlags (then again it is  
getting late and I could have missed something obvious).  I can't use  
mx:Text in this instance.  Any ideas appreciated.

Cheers,
Robin

__

Robin Hilliard
Director - RocketBoots Pty Ltd
Professional Services for Macromedia Technologies
http://www.rocketboots.com.au

For schedule/availability call Pamela Higgins:
w+61 7 5451 0362
m+61 419 677 151
e[EMAIL PROTECTED]

or Direct:
m+61 418 414 341
f+61 2 9798 0070
e[EMAIL PROTECTED]

  *** www.mxdu.com 2-3 March 2006 Sydney Australia ***



--
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/

* 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] Cairngorm is bad?

2005-11-14 Thread Robin Hilliard


No Unittests. It is very strange but after releasing FlexUnit nothing is done to improve it to support async tests. Nothing is done to implement Mock Objects in AS (however as2lib has some implementation). That is why Flex community still cannot write neither functional tests nor unittests, and they don't write them. That is why XP or Agile is impossible. That is why continious integration is impossible.Asynchronous testing is possible with Flex Unit - For instance when testing Delegates we:1) Register the test case as the service the delegate is going to call and implement the fake remote method so that it stores it's arguments in an instance variable;2) Get the testCase to implement Responder and pass it to the Delegate constructor.  the onResult and onFault, like the remote method, store their arguments in instance variables3) Now all the arguments passed to services and responders by the delegate under test are accessible by our assert statements - not hard to set up.There are quite a few Cairngorm development teams around Australia (RocketBoot's clients included) who would be surprised to find out they can't do Agile development with Cairngorm, since they've been doing it for a little while :-)  Sure some tweaks are necessary and there are some things I'd like to modify in the framework - but that's why I have an ongoing email thread with Stephen about these issues and possible solutions.  Cairngorm is not fixed in stone, and Stephen has always been keen to get contributions from the community.BTW there is already another framework some people use for Flex development, check out ARP.  I'd prefer to see people contribute to existing frameworks first, and if you have to create a new one, have a clear point of difference in mind (not just the name, hell it's taken me months to learn to type Cairngorm quickly)Cheers,RobinPS: See some of you in Hong Kong :-)__Robin HilliardDirector - RocketBoots Pty LtdProfessional Services for Macromedia Technologieshttp://www.rocketboots.com.auFor schedule/availability call Pamela Higgins:w    +61 7 5451 0362m    +61 419 677 151e    [EMAIL PROTECTED]or Direct:m    +61 418 414 341f    +61 2 9798 0070e    [EMAIL PROTECTED] *** Let RocketBoots help upgrade your team to Studio 8! ***On 15/11/2005, at 4:15 AM, Mykola Paliyenko wrote:  Dear Flexcoders. I want to start here discussion about development enterprise  applications using Flex. Our company has choosen Cairngorm as a  framework to do it, but I believe it has some drawbacks My comments are here: http://jroller.com/page/mickolka?entry=cairngorm_is_bad I'm new to Flex but not new to the ActionScript and _javascript_, also I  know lots of Java Web MVC frameworks so I have a vision about how  framework should look like to make your project succeed. Thanx for any comments.  Regards, Mykola 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  








[flexcoders] Flash + Cairngorm Example With Source Code

2005-06-16 Thread Robin Hilliard


FYI I have posted a Flash version of the Cairngorm sample application with source code on our blog:http://www.rocketboots.com.au/blog/index.cfm?mode=entryentry=83219052-E081-51EF-A73B5F4EF642C3F5Cheers,RobinOn 31/01/2005, at 11:10 AM, Robin Hilliard wrote:FYI the sample application code, README, presentation slides and meeting recording URL are available here:http://www.rocketboots.com.au/blog/index.cfm?mode=entryentry=C6173106-E081-51EF-A73336809276EB7CRobinOn 27/01/2005, at 1:50 PM, Robin Hilliard wrote: Hi All,Just letting you know that I'm doing a little presentation on Flex andCairngorm tomorrow as part of the Macromedia Australia - New ZealandCommunity seminar series. The meeting is at 3pm Australian EasternStandard Time and will be recorded. The URL ishttp://www.macromedia.com/go/anzcommunityCheers,Robin 







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.









Re: [flexcoders] Flash + Cairngorm Example With Source Code

2005-06-16 Thread Robin Hilliard


On 16/06/2005, at 7:51 PM, Steven Webster wrote:it should be ... good job; the business delegate and service locator encapsulate the Flex/Flashchange, so that your commands are oblivious to the implementation of the service (as theyshould be).Working with ColdFusion there's one thing that I'm now doing differently to the sample code - I get the delegate to intercept the server result and copy the values into an instance of the correct VO type, then call the original responder's onResult() method. This is because of an experience I had in an earlier Flash/Cairngorm app, where I discovered that what I thought was an instance of a particular VO type with some getter/setter logic (which I do occasionally use in VOs) was actually a vanilla object with no getter/setters - I had assumed that somehow the cast in my Command's onResult had turned it into the type I wanted, where in fact all it does is stop the compiler generating a type mismatch for that line of code. Andrew has just blogged about this on FlexDaddy.So for Kent, the above is one instance of the separation of the Command/Delegate being useful by hiding a server specific issue (ColdFusion's loose typing) in the Delegate. Another similar example is a Flex application we're working on that communicates in xml request/response strings with the server. All the creation of the xml request string and the parsing of the response are handled in the delegates - if we swap to a non-xml format later then the Commands will be none the wiser, they work exclusively with VOs.Finally, in the same application we have a few commands that trigger off a string of four or more server calls via delegates in a row, so the mapping of commands to delegates is 1:many (I've written a little state-machine logic in my commands onResult using (gasp) a case statement - unfortunately I haven't seen Steven's solution for this in 0.99 at this point, will have a look soon but it may take a bit to tear me from my state machines, which work rather nicely).Cheers,Robinhttp://www.rocketboots.com.au







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.









[flexcoders] OpenSTA/Flex/Remoting

2005-05-11 Thread Robin Hilliard
Hi All,

Anyone had experience using OpenSTA to record and play back AMF traffic 
from a Flex or Flash application?  One of our Flex clients is having 
some trouble with this, getting 500 errors and invalid AMF request 
messages. my first thought was that perhaps OpenSTA had mucked around 
with the ports or gateway url - any ideas appreciated.

Cheers,
Robin

http://www.rocketboots.com.au
Professional Services for Macromedia Development Teams



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* 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] Cairngorm for a newbie :)

2005-03-18 Thread Robin Hilliard
Hey Scott,

Here's some feedback on your points:

 - formalised approach to command subscriptions, in that a controller
 is established which registers itself against commands for both Views
 and Models - but in a relatively simplified syntax (ie addCommand)

A simple controller would have been a singleton with a big case 
statement to handle various events. As an itch in your OO design gland 
is no doubt warning you case statements are a clarion call to refactor, 
which the i2 guys did with the command pattern to split each case out 
into a separate class. When you add a command this limits the change 
to the controller to a single addCommand call in the constructor, and 
keeps the controller nice and small.

The other advantage of separate command classes is that the when you 
make a remoting or webservice call the result and fault handlers can be 
methods of each command class - if you hadn't split commands out into 
separate classes you would need big case statements inside onResult and 
onFault handlers, which would have seen you in emergency with a severe 
allergic reaction.

 - Seperating ViewPods from logic via ViewHelpers. It appears that
 the framework allows a developer to add behaviours or logic to a
 view but in a way that its not coupled with that said view (ie i
 assume you could add a ViewHelper to other ViewPods? - yet all feed
 off the one instance/codebase).

To me view helpers are about minimising the control logic's (Commands 
are part of the control logic) exposure to the view - up in the control 
layer you want to keep things at the sentance-in-a-use-case level 
i.e. promptUserLogin() and not sink into showPopupLoginPanel(). The 
view helper method names use a control layer vocabulary but their 
implementations are very view-aware. So the view helper provides a 
service to the control layer, not to the views themselves. I've never 
called a view helper from a view, I'm not clear what the Cairngorm 
position is on doing that, and as yet I haven't used view locators.

There have been a few discussions about how thick view helpers should 
be, I think the most recent statement was that the helper should allow 
the control layer to set the model being used by the views and not much 
else.


 - Templated Command Objects : it seems to me that the whole Command
 concept has established a base template to work from, so that
 onResult, onFault and execute are automatically invoked per command? -
 then the developer can just fill in the blanks based on the event
 type?

execute() is the only method required by the Command interface - this 
interface is the contract a Command has with the controller to handle 
events forwarded to the Command. If your command calls business 
delegates or any class that requires onResult() and onFault() callbacks 
(not all do) it implements the Responder interface. Note that there 
isn't really a neat solution yet for commands that need to call 
multiple delegates - look back through the list for some discussions on 
this, Steve has something up his sleeve for 1.0 I think. In the 
meantime you can daisy-chain commands together by broadcasting a new 
event in the first command's onResult, or risk the rash and do a case 
statement.

 - ViewLocator - kind of reminds me of DHTML's
 document.getElementById() in that it appears each ViewHelper registers
 itself within cairngorm and the ViewLocator simply provides a dynamic
 bridge between the actual view and the object requesting its location?
 or something like that?

ViewLocator, ServiceLocator and EventBroadcaster are basically just 
lookup services that return singleton instances of view helpers, 
services and the object the controller listens to for events. Just a 
bit nicer than writing _global.myService or whatever - which you could 
do if you really wanted to.

HTH

Robin



--Apple-Mail-54--342723534
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
charset=US-ASCII

Hey Scott,


Here's some feedback on your points:


excerpt - formalised approach to command subscriptions, in that a
controller

is established which registers itself against commands for both Views

and Models - but in a relatively simplified syntax (ie addCommand)

/excerpt

A simple controller would have been a singleton with a big case
statement to handle various events. As an itch in your OO design
gland is no doubt warning you case statements are a clarion call to
refactor, which the i2 guys did with the command pattern to split
each case out into a separate class. When you add a command this
limits the change to the controller to a single addCommand call in the
constructor, and keeps the controller nice and small.


The other advantage of separate command classes is that the when you
make a remoting or webservice call the result and fault handlers can
be methods of each command class - if you hadn't split commands out
into separate classes you would need big case statements inside
onResult and onFault handlers, which would have 

Re: [flexcoders] Cairngorm + Flash

2005-03-03 Thread Robin Hilliard
Hi Agha,

We've used Cairngorm to this point, but we had a good talk with Aral at MXDU comparing the two frameworks and what I've said about ARP is based on this discussion. Try the list Aral posted today in another Flexcoders thread. I need to try out some ARP ideas in a project to sort out my thinking about the two frameworks - but as Steven said ARP provides more guidance around what to do in Flash with the views, as it is originally a Flash framework. Probably the only issue I had with the demo Flex app Aral showed me was the deep purity of the mxml code - as a pragmatic (slothfull? :-) Flex programmer I am rather fond of using a bit more actionscript in my mxml, but then I understand where Aral is coming from - and in Flash I would never put code in my fla. I would be happy to recommend either framework to a client.

Cheers,
Robin
http://www.rocketboots.com.au

On 03/03/2005, at 1:29 PM, Mehdi, Agha wrote:

Not that I have a whole lot to complain about Flash mainly because I just rolled out a fairly complicated Enterprise New Business Intake app for my Company in Flash Professional, which integrates with existing internal DMS, Financial, CRM, Workflow and Intranet Portal systems but if I had the choice at that time I would've done it in Flex. Having said that, I'd still like to use Flash for small, not complicated mini apps where Flex is not the option for any reasons (just like Robin said). Ever since I got this taste of Cairngorm with Flex, I find it hard to convince myself to go with Flash without a framework as elegant as Cairngorm. That was my main reason to see if it was possible to use it with Flash.
 
I have installed ARP but didn't really get a chance to look into it. May be what I need is to develop something with it to see how good it serves me. No matter how tempted I am, I won't ask any questions about ARP implementation here. Robin, if you use ARP, will you be able to guide me to some of the stuff, which is a good knowledge base for ARP?
 
Thanks
 
-- Agha

Re: [flexcoders] MVC Framework for flex

2005-03-01 Thread Robin Hilliard
See http://www.ariaware.com/products/arp/

Cheers,
Robin
http://www.rocketboots.com.au


Do you have a link or the source of the Flex application
 written in ARP 

 Thanks 
 Willem Engelbrecht


 On Sun, 27 Feb 2005 10:49:41 +1100
 Robin Hilliard [EMAIL PROTECTED]> wrote:
 > 
 > On 26/02/2005, at 1:44 AM, Abdul Qabiz wrote:
 > >  There is another RIA framework called Ariaware made
 > by Aral. Not 
 > > sure, if
 > >  it works with Flex, but it's good for Flash no doubt.
 > 
 > Yes, Aral has a sample Flex application written in ARP,
 > and we've used 
 > Cairngorm on a Flash project - they mainly differ in the
 > way the views 
 > interact with the controller - Aral has strong views
 > against view 
 > helpers and embedding any code in mxml files.
 > 
 > Robin

Re: [flexcoders] Cairngorm + Flash

2005-03-01 Thread Robin Hilliard
Hi Agha,

Here's the main differences:

1) Instead of tags, break the UI down into library symbols and link each one to a view class. Remember all the UI controls have to be declared as properties in your class.
2) You have to install the remoting components and use mx.remoting.Service
3) In delegates use mx.rpc.RelayResponder instead of mx.utils.Delegate.
4) You'll need to tweak the service locator to allow you to register services in actionscript, or just not use the service locator.
5) Use property setters, custom updateModel/updateView methods (or something more elegant) instead of binding in the UI (probably the Flex feature I miss most in Flash, closely followed by the layout containers).

I think there's a place for RIA development in Flash - there are always going to be projects where Flex won't be an option (although it is an option more often than you'd think :-) and in those cases frameworks like Cairngorm and ARP will make things much easier. I'd say the main drawback to Flash is that UI Component Set 2 has some serious limits to it's scalability on the current player - I wouldn't attempt anything larger than a few screens in Flash.

Cheers,
Robin
http://www.rocketboots.com.au

On 02/03/2005, at 9:44 AM, Steven Webster wrote:

Agha,
 
 Can Cairngorm be used with Flash and if yes, where do I find any sample that I can look at? 
 
Sure Cairngorm can be used with Flash ... the only difference is that your user experience has to be
built up in the FLA, and not using MXML; however, all the design patterns for managing response
to user gestures, business logic, service calls, etc, still apply.
 
In the ActionScript 2.0 Dictionary, we published something very similar to the Cairngorm framework
(an early incantation of) which also includes an ActionScript 2.0 ServiceLocator for Flash Remoting.
 
I know that Robin Hilliard and the team at RocketBoots have also been using Cairngorm with both
Flash and Flex projects.
 
We've not made any recommendations as to how you should build your FLA -- truth be told, in
our humble opinion, if you're building RIA, you should be building them with Flex, not Flash. 
 
However, if you want some guidance on how to structure your FLA, you could check out what
Aral has done with his ARP framework, which provides a bit more prescription as to how you
should structure your FLA file on top of the same collection of design patterns as Cairngorm
is using.
 
Perhaps Robin Hilliard might be able to pipe up with some specific advice.
 
Mine would be to spare yourself unnecessary pain, trauma, performance woes and
wheel reinvention and use Flex ;-)
 
Hope that helps,
 
Steven
 
--
Steven Webster
Technical Director
iteration::two

Re: [flexcoders] MVC Framework for flex

2005-02-26 Thread Robin Hilliard
On 26/02/2005, at 1:44 AM, Abdul Qabiz wrote:
There is another RIA framework called Ariaware made by Aral. Not 
sure, if
it works with Flex, but it's good for Flash no doubt.
Yes, Aral has a sample Flex application written in ARP, and we've used 
Cairngorm on a Flash project - they mainly differ in the way the views 
interact with the controller - Aral has strong views against view 
helpers and embedding any code in mxml files.

Robin
http://www.rocketboots.com.au
Professional Services for Macromedia Development Teams



Re: [flexcoders] passing a view to a command

2005-02-24 Thread Robin Hilliard
Interestingly this is always the case in Aral's view-helper-less ARP framework - because the view itself (not the EventBroadcaster singleton) broadcasts the event, the controller uses the target property of the event (the view) to call methods to update the view.  

I had a talk with Aral after MXDU, was interesting to compare his approach with view helpers. It increases the encapsulation of views, but on the face of it seems to reduce the isolation that a view helper introduces between the commands and the view. It also becomes more important to bubble UI events to the right level in the views to broadcast the event to the command, otherwise the command won't have reference to a view that provides the necessary methods to carry out the command's view update requirements.

It should be added that when Aral uses ARP with Flex he never puts code in the mxml, as you would with a flash view he keeps his UI code in a class file for each view - so the exact skin of the view can be modified independently of the code. To my mind that's a little excessive - expressions in bindings are to me are a key part of Flex's RAD value proposition.

I'm thinking of trying out ARP style views with Cairngom (that would make it Carp?) to get more of a handle on the pros/cons of the two approaches.

Cheers,
Robin

On 23/02/2005, at 6:25 AM, Mehdi, Agha wrote:

Yeah, you can do that.
 
EventBroadcaster.getInstance().broadcastEvent( myCommand, this );
 
Why would you do it that way though? You can register a view with its viewHelper and than your command can use ViewLocator to get that helper that talks to your view. I don't think having your commands know about your views is a very good idea. Unless of course you have specific reasons.
From: Clint Tredway [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 21, 2005 8:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] passing a view to a command

I am using Cairngorm and I am wondering if I can pass a view to a command dynamically?




Yahoo! Groups Links

	• To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
 
	• To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
 
	• Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.

To reply to our email administrator directly, send an email to
[EMAIL PROTECTED]

Littler Mendelson, P.C.
http://www.littler.com





Bizzare - Flex app crashes on Windows player 7,0,19, works fine on Mac OSX 7,0,24

2005-02-16 Thread Robin Hilliard
Hello,
Has anyone ever come across something that works on one of these but 
not the other? Here's a summary of what we're seeing with the same 
web application across various player/server combos:

Player
OSX 10.3.8 7,0,24
Flex Server
JRun 4 on OSX
Result
Works fine
Player
Win XP 7,0,19
Flex Server
JRun 4 on OSX
Result
Application loads, then hangs player and browser when populating a 
datagrid. Low virtual memory warning appears

Player
W2K 7,0,19
Flex Server
JRun 4 on OSX
Result
Application loads, then browser and player crash completely when 
populating a datagrid.

Player
Win XP 7,0,19
Flex Server
Tomcat 5.0.27/Linux RHE 3 WS
Result
Application runs very slowly (minutes to populate datagrid).
We're going to take it up with support, but can't think what should be 
different in the players to make this happen. No embedded fonts, 
caching swos disabled. Any thoughts greatly appreciated!

Thanks,
Robin



Re: [flexcoders] DataGridColumn sortCompareFunction arguments dua l personality

2005-02-15 Thread Robin Hilliard
Thanks Matt, had grabbed wrong end of the stick on that one.

Much closer now. Noticed that the compare callback for sortItems doesn't get the third array flags argument mentioned in the docs - I was going to see if that would specify ascending or descending order, worked around by having separate sort functions for each direction.  I'm trying to track the sort column and ascending/descending as instance properties in my view - this almost works but under some conditions the arrows in the header get out of sync with my asc/desc property. Is there a way to dig into the header_mc property of the datagrid and force the up/down arrow to display one way or the other?

Thanks,
Robin

/02/2005, at 5:27 PM, Matt Chotin wrote:

x-tad-biggerYep, looks like we only pass you the values, not the object for the rows themselves.  Guess you’ll need to set sortOnHeaderRelease to false and instead call sortItems yourself with a custom compareFunc./x-tad-bigger

x-tad-bigger /x-tad-bigger

x-tad-biggerMatt/x-tad-bigger

Re: [flexcoders] Installing Flex on OS X

2005-02-08 Thread Robin Hilliard
On 09/02/2005, at 1:57 AM, Matt Horn wrote:
To fix the fonts problem, have you tried using embedded fonts rather 
than the system fonts?
 
matt
Hi Matt,
We considered it (there were some other things we wanted embedded fonts 
for as well), but we're trying to keep the download size as small as 
possible for the app in question.

Robin




Re: [flexcoders] Installing Flex on OS X

2005-02-08 Thread Robin Hilliard
On 09/02/2005, at 1:15 AM, Seth Voltz wrote:
Now if only we could get a FlashCom install for the mac I could move
*all* of our servers over to Macs. Right now we're looking at some
dedicated Linux boxes for FlashCom and the remainder of the machines
running OS X server.
Amen to that! At the moment I run flashcom on VPC7 for development - 
because you can't see the VPC from the mac I also have to use a browser 
inside VPC, but the rest can be done out on the mac.

BTW, I've just completed a Flash project that used FlashCom to share 
real time record locks in a booking application - the application used 
the Cairngorm framework, which worked a treat with a few mods for Flash 
(RelayResponder instead of Delegate and setter functions instead of 
binding in the UI).

Cheers,
Robin
http://www.rocketboots.com.au



Re: [flexcoders] Installing Flex on OS X

2005-02-08 Thread Robin Hilliard
Hi Jasper,
We've been running Flex on JRun/OS X for a while - I first installed it 
on OS X when I was at Macromedia shortly after the 1.0 release. The 
only thing we've noticed is that the fonts look much better running our 
apps in Firefox than Safari - and that the font widths are a bit 
different to Windows, causing some layout issues when windows users 
viewed our apps in IE.

Robin
http://www.rocketboots.com.au



Re: [flexcoders] Cairngorm info

2005-02-03 Thread Robin Hilliard
Hi Devis,

Here's an example of why delegates are useful on the client. Our current Flex project is based on an existing XML backend. We have one service with a single send() method to send XML strings up to the server and get XML string responses. Because this will probably change in the medium term we don't want to expose our client code to the XML, so we modified the delegate by adding an onResult handler which parses the XML string into value objects before forwarding them to the original responder. Later on if the server changes only our delegates will be affected (and greatly simplified). Using delegates gave us the elbow room to make these modifications without impacting the rest of our client application.

In another Flash project we're working on the client development is ahead of the server development, so our delegates return dummy test data to the responder so that client development can continue.

You don't want to roll the delegate code into commands or elsewhere because multiple commands may reuse the same delegate.

In Cairngorm you would pass the array of customer vos back to the command that invoked the delegate. The command would then populate the view via a view helper (to keep the UI at arms length from the commands) - the view helper would either set the dataProvider directly or perhaps a public property of a view that was then bound to the dataGrid's dataProvider property.

Did you see the sample Cairngorm application I posted earlier this week?

Cheers,
Robin
http://www.rocketboots.com.au

On 03/02/2005, at 9:19 PM, [EMAIL PROTECTED] wrote:

Thank's Steven,
 good work,
 but according to you, considering that you know an architecture J2EE and 
 his complexity, i don't know the sense to remap buisiness delgate in 
 Flex,
 rather i have just build my business delegate in j2ee and i don't know 
 if exist a logical/technical  justify can you light me!!! please.
 For pojo it's ok i understand that it's necessary for amf/flex to swap 
 java/flex  flex/java viceversa.


 /* 
   in the case that this function returns me an array of customer, 
  it is possible to hook it to a dataProvider using the your 
 approach, for example in my Customer.mxml
  as I can exploit here the  under code?
     for example
   mx: DataGrid dataProvider=??

 /*/
     public function login( loginVO : LoginVO ): Void
     {
     var call = service.login( loginVO );

     call.resultHandler = Delegate.create( Object( responder ), 
 responder.onResult );    
     call.faultHandler = Delegate.create( Object( responder ), 
 responder.onFault ); 
     }


 thanks a lot of and excuse me if I make you lose the time
 Best
 Devis

 Steven Webster ha scritto:

 >Hi Devis,
 >
 >  
 >
 >>If you look at the file Services.mxml I don't understand as 
 >>ServiceLocator.as the class you/he/she able does to memorize
 >>all the RemoteObjects, don't I see containers? Can someone
 >>explain me this file mxml??? 
 >> 
 >>cairngorm:ServiceLocator xmlns:mx =
 >>http://www.macromedia.com/2003/mxml xmlns:cairngorm = 
 >>com.iterationtwo.cairngorm.business. * > 
 >> 
 >>   mx:RemoteObject id = customerDelegate source = 
 >>com.iterationtwo.demo.business.CustomerDelegate
 >>    protocol = http showBusyCursor = true 
 >>    result = event.call.resultHandler (event)  
 >>    fault = event.call.faultHandler (event) > 
 >>   / mx:RemoteObject>
 >> 
 >>/ cairngorm:ServiceLocator>
 >>    
 >>
 >
 >So the idea of the ServiceLocator (as you'll know from j2ee) is to
 >present an encapsulation of all service lookup; in RIAs we're talking
 >about RemoteObject (tight java-coupling), WebService and HTTPService
 >services.
 >
 >We used to advocate ServiceLocator as an ActionScript 2.0 class -
 >it was a singleton class, with getInstance(), that encapsulated all
 >the Flash Remoting integration that it was necessary to perform.
 >
 >However, Flex does *so* much more for us than plain-old Flash
 >Remoting, so we made a decision for Cairngorm 0.9 to simplify
 >the ServiceLocator down to an MXML file that is instantiated from
 >your top-level Application, as a registry of services.
 >
 >By declaring all of your application services here, your business
 >delegate can easily locate services, invoke them, and pass responses
 >from the services back to the command classes that call them.
 >
 >In fact, by adding a ServiceLocator.as class with Flash Remoting
 >logic in it (look at the ActionScript 2.0 dictionary for an example),
 >you can use Cairngorm with Flash RIA as well -- we have done in the
 >past (most recently for a project running in the National Space
 >Museum in the UK !) and there are flexcoders on this list doing so
 >as we speak.
 >
 >So - quite simply, declare all your services in the Services.mxml
 >file, and then look at the business delegate class to see how the
 >Service Locator is used to handle all the underlying invocation
 >of 

Re: [flexcoders] Breeze Live Presentation on Flex and Cairngorm

2005-01-31 Thread Robin Hilliard
FYI the sample application code, README, presentation slides and meeting recording URL are available here:

http://www.rocketboots.com.au/blog/index.cfm?mode=entryentry=C6173106-E081-51EF-A73336809276EB7C

Robin

On 27/01/2005, at 1:50 PM, Robin Hilliard wrote:

Hi All,

 Just letting you know that I'm doing a little presentation on Flex and
 Cairngorm tomorrow as part of the Macromedia Australia - New Zealand
 Community seminar series.  The meeting is at 3pm Australian Eastern 
 Standard Time and will be recorded.  The URL is

http://www.macromedia.com/go/anzcommunity

 Cheers,
 Robin

Re: [flexcoders] Cairngorm ViewHelpers and Views and Commands

2005-01-30 Thread Robin Hilliard
On 22/01/2005, at 6:07 PM, dave buhler wrote:

 1) Should the views be nothing more than the forms? Where does the
 validation go?

Hi Dave,

So far what I've done for validators, filters, formatters and other business helper classes is make sure they stay pure business logic e.g. working with arrays or single VOs, and add them to my business package - they're business logic I want to reuse, so it seems to be a good place for them. I then instantiate them on in my view and use them directly, e.g:

business:ContactFilter id=contactFilter/>


mx:Form>
mx:FormItem label=Filter>
mx:TextInput id=criteriatxt/>
/mx:FormItem>
/mx:Form>

mx:DataGrid id=grid dataProvider={contactFilter.filter(contactList, criteriatxt.text)}...

It doesn't hurt the reuse prospects of the view or the business helper doing this - the business helper is more permanent than the view, and the business helper is oblivious to where it's being used. My rule of thumb is that if it doesn't affect the model and it can't affect other parts of the UI then it doesn't necessarily have to go up through a command. 

As for shared variables, so far our global scope has been the application, we keep the central VOs there and bind them down through public properties to any view that needs to reference them. Not sure if that was your problem.

Hope that helps.

Robin
http://www.rocketboots.com.au