Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: question about Architecture  (Read 7119 times)
davidTikva
Jr. Member
**
Posts: 12


View Profile Email
« 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
davidTikva
Jr. Member
**
Posts: 12


View Profile Email
« Reply #2 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?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 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>
Logged
Pages: [1]
Print