cgi::panel

10
CGI::Panel CGI::Panel Create sophisticated Create sophisticated event-driven web event-driven web applications from simple applications from simple panel objects” panel objects”

Upload: wattan

Post on 06-Jan-2016

29 views

Category:

Documents


0 download

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

Page 1: CGI::Panel

CGI::PanelCGI::Panel

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

simple panel objects”simple panel objects”

Page 2: CGI::Panel

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

Page 3: CGI::Panel

Application DesignApplication Design

SimpleApp

Basket Basket Sidebar

MainMenu Details

Page 4: CGI::Panel

How this could lookHow this could look

Could look like this:Could look like this:

Page 5: CGI::Panel

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

Page 6: CGI::Panel

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

Page 7: CGI::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

Page 8: CGI::Panel

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.

Page 9: CGI::Panel

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)

Page 10: CGI::Panel

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 }}