Re: Framework for PHP-GTK app
| From: | Pablo Dall'Oglio | Date: | Wed, 03 Aug 2005 13:57:02 +0000 |
| Subject: | Re: Framework for PHP-GTK app | ||
| References: | 1 2 3 4 5 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6142@lists.php.net to get a copy of this message | ||
On Qua, 2005-08-03 at 09:44 -0400, Scott Mattocks wrote:
> Pablo Dall'Oglio wrote:
>
> > It's a little bit painfull to write a database application in php-gtk
> > without a set of class wrappers for common stuffs (forms, menus, etc),
> > and without a set of classes for DB persistence. Of course, it's just a
> > part of a framework.
> >
> > * Model:
> > * An abstraction of some real-world process or system
> > * Encapsulates data and functions that operate on it
> > * Notifies observers when data changes
> > * View:
> > * The system's user interface
> > * Attaches to the model and renders its contents to the
> > display surface
> > * Automatically redraws the affected part when the model
> > changes
> > * Controller:
> > * Controls the application flow
> > * Accepts input from the user and instructs the model and
> > the view to perform actions based on that input
>
> The model and view pieces I understand but the controller is what throws
> me off. I don't understand why you would have all events go through a
> central location. I don't see the benefit there. With a web application
> you have lots of user input to verify and clean. With a GUI app there
> isn't so much. Also the view doesn't change that drastically with every
> action. I'd like to see an example of MVC being used with a GUI app if
> anyone has one.
>
Usually, the majority of php-gtk programmers connect the signals of the
interface to the functions in the same place where the interface is
created, letting this things tied.
Writing a DB application you may want to use a view like a "Person
List", sometimes just to find a person (for a lookup), another times you
want a Person List to edit the records too. Separating the actions from
the view "Person List", you don't need to have the interface code twice
or more... on your system.
Pablo
> Scott
>
>
--
:: Pablo Dall'Oglio
:: www.solis.coop.br - Lajeado, RS - Brasil
:: www.dalloglio.net - Personal Home Page
:: The software is free, but the work isn't.