cgi::panel

Post on 06-Jan-2016

30 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

CGI::Panel. “Create sophisticated event-driven web applications from simple panel objects”. CGI::Panel. Different Approach Distribution of Logic Simple ‘driver’ CGI script + panel classes inherited from CGI::Panel Logical way to write an interface. Application Design. How this could look. - PowerPoint PPT Presentation

TRANSCRIPT

CGI::PanelCGI::Panel

““Create sophisticated event-Create sophisticated event-driven web applications from driven web applications from

simple panel objects”simple panel objects”

CGI::PanelCGI::Panel

Different ApproachDifferent Approach Distribution of LogicDistribution of Logic Simple ‘driver’ CGI script + panel Simple ‘driver’ CGI script + panel

classes inherited from CGI::Panelclasses inherited from CGI::Panel Logical way to write an interfaceLogical way to write an interface

Application DesignApplication Design

SimpleApp

Basket Basket Sidebar

MainMenu Details

How this could lookHow this could look

Could look like this:Could look like this:

BenefitsBenefits

Clearly defined separation of code into Clearly defined separation of code into easily manageable chunkseasily manageable chunks

All the benefits of OO programming – All the benefits of OO programming – inheritance, polymorphism, encapsulationinheritance, polymorphism, encapsulation

Reduced development timeReduced development time Easy restructuring and maintenanceEasy restructuring and maintenance Application design is implicit in panel Application design is implicit in panel

hierarchyhierarchy Panels are reusablePanels are reusable

Provided freeProvided free

Event trigger and distribution Event trigger and distribution mechanismmechanism

Parameter distribution mechanismParameter distribution mechanism Lightweight persistenceLightweight persistence Access to ‘parent’ panelAccess to ‘parent’ panel Access to main panelAccess to main panel

EventsEvents

Triggered by special button or linkTriggered by special button or link Handled by the panel that generated Handled by the panel that generated

the eventthe event Access to localized parameter listAccess to localized parameter list

ParametersParameters

Defined similarly to the CGI moduleDefined similarly to the CGI module Special ‘get_localised_name’ method Special ‘get_localised_name’ method

returns a name suitable for use in an returns a name suitable for use in an HTML formHTML form

Panel-specific parameter list then Panel-specific parameter list then obtained using ‘local_params’ obtained using ‘local_params’ method.method.

PersistencePersistence

Handled by Apache::SessionHandled by Apache::Session Complete panel hierarchy stored, Complete panel hierarchy stored,

along with any attached dataalong with any attached data Transparent to the programmer (no Transparent to the programmer (no

extra code needed)extra code needed)

ComparisonComparison Standard CGIStandard CGI

loop {loop { Read http headersRead http headers Process parametersProcess parameters Retrieve/set up Retrieve/set up

statestate (Lots of ifs, elsifs (Lots of ifs, elsifs

etc)etc) Output htmlOutput html }}

CGI::PanelCGI::Panel

Set up applicationSet up application loop {loop { Respond to Respond to

eventevent Display each Display each

panelpanel }}

top related