Re: [GnomeMeeting-devel-list] Refactoring the addressbook code



Damien Sandras a écrit :
Le mardi 28 mars 2006 à 18:17 +0200, Julien PUYDT a écrit :
Damien Sandras a écrit :
For yourself, no.
Why ?
Because it would be counter natural.
If you ask to the back-end "change my status to away", it will certainly
not trigger a callback telling "done dude".
Well... that's how it works for most things. It's called the model-view-controller (MVC) organisation...

OK, then have a look to see if GLOOX supports the MVC organization and
report back... (I already know the answer).

I just had a quick look to its roster management api, and see a roster is managed by a RosterManager class.

From http://camaya.net/api/gloox/classgloox_1_1RosterManager.html I learn that it's possible to register RosterListeners to a RosterManager.

But what is a RosterListener !? I click on the link which leads me to http://camaya.net/api/gloox/classgloox_1_1RosterListener.html where I learn that it's an object with methods named itemAdded, itemSubscribed, itemRemoved, itemUpdated, itemChanged...

Which means you have a backend (RosterManager) on which several frontends (RosterListener) can "connect", and live together happily, all being automatically notified when one of them makes a change !

Sure, it's not written "MVC" in big letters... but still, the ideas remain.

Snark



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]