Hi Murat.

I'm still a relative POE newbie, but since no-one else has stepped up to 
answer your question, I'll try.

While MVC is a good model for modelling interaction with the user, this is 
often used implicitly rather than explicitly, so I'd be surprise if you 
find a module for it.  ie, the session state is the Model, input events 
(perhaps collected by the Gtk, Tk or Curses extensions) are the 
Controller, and the objects which contain the display (ie, Gtk window 
objects, Curses screen objects etc) along with their ->update() functions 
are the View.

For a web-based system, the HTTP or CGI request is the controller, the 
session state is the model and the HTTP response is the view.

Of course, seperating each part of the process into a seperate sections of 
code is a good design practice, though perhaps rarely followed - most 
applications will intermix the View and Model stages, in particular.  This 
is the same phenomenon as saying use of a templating system makes web 
applications more maintainable.

POE::Session itself can be used as a finite state machine; just place a 
variable in the session heap that is called `state', and have if (state == 
"this") { } etc switches in each event handler.  This may be easier to 
understand if POE::NFA was too hard for you the first time; and it will be 
easy to switch to POE::NFA later on.  Did you find any POE::NFA example 
programs?

Abstracting, say a Gtk and/or a web based system into a single MVC 
framework would be quite a commendable project and pretty much 
unprecedented AFAIK :-).  (Debian's debconf system does have something 
like this, actually, but it's a bit of a hack IMHO).

I have a web application framework that is similar to an MVC model, eg my 
Request::CGI is a descendant of Request, and my Response::HTTP is a 
descendant of Response, though I haven't tried to clearly define the base 
`Request' and `Response' classes in a manner that would suit being 
extended to `Request::GtkEvent', `Response::Gtk', `Request::Curses' etc. 
e-mail me if you're interested; the system wasn't designed for POE but 
because it was written for FastCGI, it's already kind of event based.

Mozilla's Chrome/XUL system offers an attractive, but currently little 
understood method of achieving similar goals; the same core application 
code can run locally as well as running inside any Mozilla browser.

Good luck,
Sam

On Sun, 16 Feb 2003 11:49, Murat �nalan wrote:
> Could somebody give me just a skeleton how to start with that ? I would
> finish the work and give it back as a full Cookbook recipe (if
> accepted).
>
> I want to create a really generic 'wizard' application (also known as
> 'druid'). It should work from the shell or via the browser.
>
> In my thoughts i have
>
>  my_wizard
>   page_a
>     input_field_a
>     input_field_b
>   page_b
>     input_field_a
>     input_field_b
>
> AFAIK an elegant way would to employ 'model-view-controller' (MVC) at
> least for the input_fields, and a statemachine (FSA) for the pages.
>
> I have a feeling in my stomach that this is a perfect job for POE. But
> after starting with POE::NFA
> i got stuck. It isn't that rich as i expected. Also i didn't find
> premade MVC POE components, though
> i was sure that POE has that already.
>
> Any ideas/tips welcome.
>
> Murat

-- 
Sam Vilain, [EMAIL PROTECTED]

  I dont have any solution, but I certainly admire the problem.
ASHLEIGH BRILLIANT

Reply via email to