GUI backend discussion

Jan Hudec bulb at ucw.cz
Sun Jun 25 19:08:06 BST 2006


On Fri, Jun 16, 2006 at 18:00:20 +0200, Szilveszter Farkas wrote:
> Hello bzr World,
> 
> we had a short discussion about the GUI project on #bzr. Please let me
> explain some things before I get to the point.
> 
> When I first had the idea to create a GUI for bzr, I thought the bast
> way would be to design the UI and just code the needed event handlers
> that communicate with bzrlib directly. My proposal for the Google
> Summer of Code included this approach.
> 
> After I got accepted, we had a discussion going on at #bzr, and an
> idea had arisen: we should support more frontends (e.g. GTK and QT),
> which could be achieved by providing a solid backend that does
> everything. We (my mentor, Mario and I) thought this were a great
> idea, and that we should go along this way to make both GNOME and KDE
> users happy.
> 
> But today, after working on the backend code for a week, I was told,
> that I'm not doing things right: the backend is pretty useless, all
> the validation and such things should happen in the UI code. I agreed
> with them (Jelmer and Robert), but I'm still not sure which way is the
> better one.

For me I miss answer to one question a bit. What will the "backend" *do*?

IMHO you should try to follow the model-view-controller pattern as much as
applicable.

The 'model' are just the Branch, Tree and Revision (plus maybe few more)
bzrlib objects. If you find that some postprocessing of their contents would
be useful to more than one frontend, I'd argue it should be added to their
interface rather than as another layer above them.

The 'view' is what you create in the ui designer. This is completely
toolkit-specific. Only code that should be here is a code that loads data to
the widgets and connects signals (in web applications 'view' is the templates
-- NO code at all).

Last the 'controller' is the actions the user can do. Both KDE and Gnome have
a notion of actions (KAction, resp. GnomeAction) and for both of them Olive
would contain almost identical actions. And almost identical to Commands for
the CLI. But as Robert already said, first you need to implement some of them
and than you'll see how much common code with Commands you can factor out.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060625/1f4222d5/attachment.pgp 


More information about the bazaar mailing list