Adobe Dreamweaver Forums



Last 10 THreads :         Making constraints on a symbol... (Last Post : sirkibble2 - Replies : 0 - Views : 1 )           »          Creating a boundry in the stage... (Last Post : fazstp - Replies : 2 - Views : 3 )           »          Director or Flash? (Last Post : Sean Wilson - Replies : 1 - Views : 2 )           »          DW8 Activation not working (Last Post : moonliner - Replies : 0 - Views : 1 )           »          Re: Mouse capture won't activate (Last Post : robertnagle - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          How come the html is being displayed, and not the link (Last Post : Skaterstu - Replies : 0 - Views : 1 )           »          Another way to accomplish this (Last Post : Andy-K - Replies : 2 - Views : 3 )           »          HELP! Cannot upload files in DW CS4 (Last Post : dan@hoppernet.org - Replies : 6 - Views : 7 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-09-2008, 09:23 AM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Communication Throughout Application and Components

Up to now my experience with Flex/AIR has been mostly small programs, studying
Flex/AIR, and the joy of contributing to this forum.

I'm now in the middle of developing my first "real" Flex/AIR app, in that it
is tied to a quarterly goal, and over time others in my department will
actually use it.

I've broken the app into several MXML components, and there are components
that use components, that use components (several levels of nested components).

As you might imagine, sometimes these components need to reference
variables/functions in other components, or in the main app, and I think I've
done fairly well, based on my limited experience with this sort of thing (I'm
not a programmer by trade, but I seem to fairly sharp ???), but I can't help
think things are too tightly coupled.

Should I be trying to push the limit in communicating between the app and the
components and among the components using only events, often custom events,
entirely if possible?

I know practice makes perfect, or well, you know..., but I want to "do it
right" as much as possible now.

Thanks very much!!!
Greg



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-09-2008, 09:39 AM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

Reading your post I think: PureMVC. Its core is all about decoupling. Great for the job you are doing.
Reply With Quote
  #3 (permalink)  
Old 10-09-2008, 03:42 PM
g-s-b
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

An "Application Framework" is what you need.
There are many in Flex including PureMVC, Cairngorm and others.
I found one seemingly unique in the Flex world, Mate: a "tag based" framework.

Within Mate you can implement many design patterns, not just MVC; one of which
is sure to meet your application needs and programming style.

Mate Link: http://mate.asfusion.com/



Reply With Quote


  #4 (permalink)  
Old 10-09-2008, 04:41 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

There was an email this morning asking a similar question on the Adobe internal
Flex mailing list, and they mentioned Mate as well (fate???).

This is all good info, but in that email they suggested learning flex well
first, including the using events effectively, modules, etc.

I wonder if you all might be able to comment on one of my original questions:

"Should I be trying to push the limit in communicating between the app and the
components and among the components using only events, often custom events,
entirely if possible?"


Reply With Quote
  #5 (permalink)  
Old 10-09-2008, 05:25 PM
g-s-b
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

OK, although I am not the best at Flex, here is what I think.

"Should I be trying to push the limit in communicating between the app and the
components and among the components using only events, often custom events,
entirely if possible?"

No, well maybe or sure. It depends...

There are major segments in a Flex swf: Application, UI views, components and
controls... As well as different kinds of events, say user gestures and system
events.

And there are many design patterns that make the application lifecycle
manageable: development, testing and maintenance.

Design patterns differ in approach: some tightly couple a view to it's
controller/model. Even there the view may be active or passive. A tightly
coupled active view would simply call methods on it's associated
model/controller whereas a passive view may have data pushed into it via
bindings and injectors.

The controller may use events to access services from the main application
controller.

So it is the design structure (design pattern) that guides one along with a
consistent set of guidelines for the development: events vs calls vs bindings
vs injectors vs observers...

Consistence is the key. And a good proven design pattern that fits your
particular application needs is the key design guide: events vs method call;
passive vs active view; ...etc.

And finally, it is often a "framework" that provides the foundation and
supplies the specialized classes to ease the implementation.

This set of articles on the "Presentation Design Pattern" is a good read and I
recommend you read it for a far better understanding that I can offer. That is
simply the Presentation Pattern and of course there are many others like MVC.

Mate is simply a framework; a lib of tag elements that better enables the
application of your selected design pattern into the Flex framework. It is
event and injector oriented.

Well, I hope that helps.



Reply With Quote
  #6 (permalink)  
Old 10-09-2008, 05:41 PM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

Without a doubt - yes.
Most certainly in app's that need to last longer, it is vital to decouple as
much as you can.
In most apps I use PureMVC and I guess the main reason is the Mediator. This
class is loosely coupled to a mxml (most likely) component by way of a
reference. The Mediator registers event listeners with the framework for the
events it's interested in. And when receiving an event acts by using the API of
the mxml component. The mxml component only dispatches events to the Mediator
and the Mediator then decides what to do.
Today I needed to do a client change on a running app and the only thing I
needed to do was modify a Mediator to listen for an event that was already
broadcasted and add a public function to its mxml component.
In every aspect I can honestly say that an event driven app is in my point of
view the way to go.

Reply With Quote


  #7 (permalink)  
Old 10-09-2008, 05:41 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

Thanks for your input Greg. I'm a little weak on design patterns. Right now I'm
trying to firm up my uderstanding of MVC and possibly MVP, so I can start to
introduce some of these concepts into my app.

Greg

Reply With Quote
  #8 (permalink)  
Old 10-09-2008, 05:41 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components


"Greg Lafrance" <webforumsuser@macromedia.com> wrote in message
news:gcl8b2$ptt$1@forums.macromedia.com...
> There was an email this morning asking a similar question on the Adobe
> internal
> Flex mailing list, and they mentioned Mate as well (fate???).
>
> This is all good info, but in that email they suggested learning flex well
> first, including the using events effectively, modules, etc.
>
> I wonder if you all might be able to comment on one of my original
> questions:
>
> "Should I be trying to push the limit in communicating between the app and
> the
> components and among the components using only events, often custom
> events,
> entirely if possible?"


That's how I've done it (bear in mind, I've only been doing this for a
year). I'm starting to get to the point where I want to use a framework,
but this is in large part because I want to write an eLearning framework and
I doubt I'll succeed without first understanding existing frameworks.

HTH;

Amy


Reply With Quote
  #9 (permalink)  
Old 10-09-2008, 05:51 PM
g-s-b
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

@greg - I have decided to move from an MVC/MVP model to the Presentation
Model. It "feels" better to me and fits well with the kinds of applications I
would like to develop.

@LuigiL - The presentation model eliminates the need for the mediator. The
mediator in flex is really a hold over from flash developers; flex really does
not need the same development techniques. But there are enough "design
patterns" to go around, LOL. So whatever fits the goals best is most likely
the best to employ.



Reply With Quote


  #10 (permalink)  
Old 10-09-2008, 06:14 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Communication Throughout Application and Components

Here is a link that gets down to a really practical level for me. It shows an
albeit simple example of taking a Flex app all in one file and breaking it into
components using a simple MVC pattern. Thanks again for your help on
understanding this.

http://clockobj.co.uk/2007/10/17/sim...or-adobe-flex/


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 02:28 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk