Re: [flexcoders] Cairngorm ModelLocator array filter...

2008-04-15 Thread Vivian Richard
Wow liked both the solutions. One is to make a copy and then add the
filter function and the other one is to add the filer function in
command.

Great thanks.




On Mon, Apr 14, 2008 at 3:26 PM, gabriel montagné <
[EMAIL PROTECTED]> wrote:

>   On Mon, Apr 14, 2008 at 12:49 PM, hworke <[EMAIL 
> PROTECTED]>
> wrote:
> >
> > Hi I am using Cairngorm and in my ModelLocator I do
> > have an array. I want to filter that array with a
> > filter function. My question is where do I put this
> > filter function: in a separate file or in the
> > ModelLocator class?
>
> I personally (and the other guys on my team) we like to keep the models
> with absolutely no logic at all. The beauty of the command pattern is
> that all the logic is kept in small, discrete classes, all nicely tucked
> into their appropriate packages.
>
> If we need to setup sorts and filters or whatever on the data on the
> model, we do it from the commands that set that data initially. If you
> do need to keep changing that filter from time to time, I would further
> abstract it into another event + command pair.
>
> Once we did a search like that. We had a package of commands for
> processing search that would be in charge of taking the query and use it
> to build the custom filters and sorts for the catalog data.
>
> Hope this helps,
> G.
>
> --
> gabriel montagné láscaris comneno
> http://rojored.com
> t/506.8392.2040
>  
>


Re: [flexcoders] Cairngorm ModelLocator array filter...

2008-04-14 Thread gabriel montagné
On Mon, Apr 14, 2008 at 12:49 PM, hworke <[EMAIL PROTECTED]> wrote:
>
>  Hi I am using Cairngorm and in my ModelLocator I do
>  have an array. I want to filter that array with a
>  filter function. My question is where do I put this
>  filter function: in a separate file or in the
>  ModelLocator class?

I personally (and the other guys on my team) we like to keep the models
with absolutely no logic at all.  The beauty of the command pattern is
that all the logic is kept in small, discrete classes, all nicely tucked
into their appropriate packages.

If we need to setup sorts and filters or whatever on the data on the
model, we do it from the commands that set that data initially.   If you
do need to keep changing that filter from time to time, I would further
abstract it into another event + command pair.

Once we did a search like that.  We had a package of commands for
processing search that would be in charge of taking the query and use it
to build the custom filters and sorts for the catalog data.

Hope this helps,
G.

-- 
gabriel montagné láscaris comneno
http://rojored.com
t/506.8392.2040


Re: [flexcoders] Cairngorm ModelLocator array filter...

2008-04-14 Thread Daniel Gold
depends on your architecture and what feels best in your project. Problem
with filtering an ArrayCollection directly in the model is that any views
bound to that model will also be filtered. Usually I have a large dataset in
an ArrayCollection in the model, and have a view that might have a search
box that filters items in a list. I create a new ArrayCollection in that
view, set the arrayCollection.source =
modelLocator.dataArrayCollection.source, and then apply a filterFunction to
the local arrayCollection specific to that view. That way each view has ways
of filtering its own local ArrayCollection wrapper around the same data set
in the model.

But to each their own. Depends on how shared the data is and how you like to
keep things divided

On Mon, Apr 14, 2008 at 1:49 PM, hworke <[EMAIL PROTECTED]> wrote:

>
>
> Hi I am using Cairngorm and in my ModelLocator I do
> have an array. I want to filter that array with a
> filter function. My question is where do I put this
> filter function: in a separate file or in the
> ModelLocator class?
>
>  
>


RE: [flexcoders] Cairngorm ModelLocator

2005-10-06 Thread Malcolm
Personally couldn't see a problem with doing that Simon.

hmmm a factory approach for multiple ModelLocators, now that would be
cool! Provided binding still worked that this is :]

m

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Simon Fifield
Sent: Wednesday, 5 October 2005 8:50 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm ModelLocator

HI

This brings up an interesting problem I had recently with the
ModelLocator.initialise() method. I am trying to use Binding to its full
use, but I had a situation where I was binding to a ModelLocator value
before it was being initialised and my view was screwed - the ModelLocator's
initialise call in the Applications initialize event handler - which gets
called after all the other initialize handlers.

So I just added a static variable "initialised:Boolean" and now I can
initialise the ModelLocator anywhere in the app either in a view or a
ViewHelper.

Do you guys think that this is a good, bad or indifferent approach?

Regards,
Simon

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Steven Webster
Sent: 04 October 2005 21:01
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm ModelLocator

Hey,

We would tend to have global model objects all hung off the one
ModelLocator.  For instance, we might have a class Assets.mxml which itself
contains 100+ attributes for embedded images, but we'll have one attribute
in ModelLocator called assets.

However, if you wanted to have multiple ModelLocators, I'd recommend a
factory strategy similar to the old cairngorm ViewLocator or ServiceLocator,
where the ModelLocator becomes a factory rather than a singleton, and you do
things like:

ModelLocator.getModel("assets").bannerImage

I've a funny feeling we considered this in the Cairngorm Committee, and
there were issues with data-binding that chose us to not go for this in the
general cairngorm package.

But I could be talking rubbish.

Steven

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: 04 October 2005 20:22
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm ModelLocator

Is the ModelLocator intended to be the *only* global repository for
variables to which you'll need to bind throughout your application? My
ModelLocator is getting huge, and I would like to split it into a few
ModelLocators (with different names, obviously). Has anyone done this?
Are there any caveats of which I should be aware? How have others dealt with
their ModelLocator's large size?




 Yahoo! Groups Sponsor ~--> Get
Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

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



 



 Yahoo! Groups Sponsor ~--> Most
low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
~-> 

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



 






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



 




 Yahoo! Groups Sponsor ~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
~-> 

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

2005-10-05 Thread Simon Fifield
HI

This brings up an interesting problem I had recently with the
ModelLocator.initialise() method. I am trying to use Binding to its full
use, but I had a situation where I was binding to a ModelLocator value
before it was being initialised and my view was screwed - the ModelLocator's
initialise call in the Applications initialize event handler - which gets
called after all the other initialize handlers.

So I just added a static variable "initialised:Boolean" and now I can
initialise the ModelLocator anywhere in the app either in a view or a
ViewHelper.

Do you guys think that this is a good, bad or indifferent approach?

Regards,
Simon

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Steven Webster
Sent: 04 October 2005 21:01
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm ModelLocator

Hey,

We would tend to have global model objects all hung off the one
ModelLocator.  For instance, we might have a class Assets.mxml which itself
contains 100+ attributes for embedded images, but we'll have one attribute
in ModelLocator called assets.

However, if you wanted to have multiple ModelLocators, I'd recommend a
factory strategy similar to the old cairngorm ViewLocator or ServiceLocator,
where the ModelLocator becomes a factory rather than a singleton, and you do
things like:

ModelLocator.getModel("assets").bannerImage

I've a funny feeling we considered this in the Cairngorm Committee, and
there were issues with data-binding that chose us to not go for this in the
general cairngorm package.

But I could be talking rubbish.

Steven

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: 04 October 2005 20:22
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm ModelLocator

Is the ModelLocator intended to be the *only* global repository for
variables to which you'll need to bind throughout your application? My
ModelLocator is getting huge, and I would like to split it into a few
ModelLocators (with different names, obviously). Has anyone done this?
Are there any caveats of which I should be aware? How have others dealt with
their ModelLocator's large size?




 Yahoo! Groups Sponsor ~--> Get
Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

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



 



 Yahoo! Groups Sponsor ~--> Most
low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
~-> 

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



 





 Yahoo! Groups Sponsor ~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
~-> 

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

2005-10-04 Thread Steven Webster
Hey,

We would tend to have global model objects all hung off the one
ModelLocator.  For instance, we might have a class Assets.mxml which itself
contains 100+ attributes for embedded images, but we'll have one attribute
in ModelLocator called assets.

However, if you wanted to have multiple ModelLocators, I'd recommend a
factory strategy similar to the old cairngorm ViewLocator or ServiceLocator,
where the ModelLocator becomes a factory rather than a singleton, and you do
things like:

ModelLocator.getModel("assets").bannerImage

I've a funny feeling we considered this in the Cairngorm Committee, and
there were issues with data-binding that chose us to not go for this in the
general cairngorm package.

But I could be talking rubbish.

Steven

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: 04 October 2005 20:22
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm ModelLocator

Is the ModelLocator intended to be the *only* global repository for
variables to which you'll need to bind throughout your application? My
ModelLocator is getting huge, and I would like to split it into a few
ModelLocators (with different names, obviously). Has anyone done this?
Are there any caveats of which I should be aware? How have others dealt with
their ModelLocator's large size?




 Yahoo! Groups Sponsor ~--> Get
Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

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



 



 Yahoo! Groups Sponsor ~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
~-> 

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

2005-10-04 Thread JesterXL
New Class.  For example, for GUI related things (skin names, image 
locations, mp3 locations, etc.) and other various graphical thigns that have 
absolutely nothing to do my apps logic, but are very important for it to 
actually look right, and sometimes work, I just put in a constants.

class com.project.model.ViewConstants
{
static var IMAGE_DIR:String = "images";
}

You could even put it into View if you wanted.

I have the same thing for application configurations; where to read my 
static XML files, if I have a local username stored in an XML file or if I 
should ignore Application vars (variables appended the URL).  Stuff like 
that is kept in a Constants file and usually only used by Controller 
classes.

You can even nest your package(s)  if you want in model.  Up to you really.

- Original Message - 
From: "fowleryj" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, October 04, 2005 3:21 PM
Subject: [flexcoders] Cairngorm ModelLocator


Is the ModelLocator intended to be the *only* global repository for
variables to which you'll need to bind throughout your application? My
ModelLocator is getting huge, and I would like to split it into a few
ModelLocators (with different names, obviously). Has anyone done this?
Are there any caveats of which I should be aware? How have others
dealt with their ModelLocator's large size?





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







 Yahoo! Groups Sponsor ~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

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

2005-10-04 Thread João Fernandes

I'm using several Models with no problems.
Till now I had no problem dealing with several files.

-Original Message-
From: flexcoders@yahoogroups.com on behalf of fowleryj
Sent: Tue 04-Oct-05 8:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm ModelLocator
 
Is the ModelLocator intended to be the *only* global repository for
variables to which you'll need to bind throughout your application? My
ModelLocator is getting huge, and I would like to split it into a few
ModelLocators (with different names, obviously). Has anyone done this?
Are there any caveats of which I should be aware? How have others
dealt with their ModelLocator's large size?





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



 





 Yahoo! Groups Sponsor ~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

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