PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: davidTikva on August 10, 2010, 06:18:55



Title: question about Architecture
Post by: davidTikva on August 10, 2010, 06:18:55
Hey, I'm new with PureMVC and I got a question about my architecture.
In my applicaion I'm managing users, so I created: UserIDProxy
when user is created (by a press of a button for example) I create UserIDProxy and add it
to the facade with registerProxy() method.

as I said, I want to manage the users. for example to check how many users there are in the system
or make search by name/id.
how am I doing it?

I thought about creating UsersProxy class which will manage all the UserIDProxy objects
is that good idea?

thanks in advanced,
David


Title: Re: question about Architecture
Post by: puremvc on August 10, 2010, 07:03:43
You might just make the UserProxy hold a collection of User objects rather than having a separate UserIDProxy instance registered for each user. This means you can iterate over all users, as well as keeping an associative array by name or ID.

-=Cliff>


Title: Re: question about Architecture
Post by: davidTikva on August 10, 2010, 09:47:04
You might just make the UserProxy hold a collection of User objects rather than having a separate UserIDProxy instance registered for each user. This means you can iterate over all users, as well as keeping an associative array by name or ID.

-=Cliff>

thanks, and where is the best place for the collection?


Title: Re: question about Architecture
Post by: puremvc on August 11, 2010, 06:46:04
As the data property of the Proxy. Expose a getter that casts data to type ArrayCollection (or Array if you like).

-=Cliff>