4The Five Ways of Building Oracle Web Applications Java Servlets (and Java Server Pages)PL/SQL Stored Procedures (and PL/SQL Server Pages)Designer PL/SQL Web GeneratorOracle 9i Application Server Portal (previously called WebDB)Oracle Developer (Forms and Reports)
6Java ServletsThe user requests a Web page (by typing in a URL, clicking a link, or pressing a button).The Apache HTTP server determines that the request is for a Java servlet and passes the request to the mod_jserv module.The mod_jserv module passes the request to the JServ servlet engine.The JServ servlet engine loads the requested servlet, creates a request object, which includes all the information from the request, and a response object, and passes both to the servlet.The servlet class executes, using JDBC to connect to the database if necessary. It writes the output to the response object.
7Advantages and Disadvantages Java is a more modern and feature-rich programming language than PL/SQLNew language to learn for many Oracle developersJava Servlets are not bound to a specific vendorNeed much code (JDBC) or non-standard features (SQLJ) to retrieve data from databaseSome overhead in establishing a database connection
9PL/SQL Web Applications The user requests a Web page by typing in a URL, clicking a linkor pressing a button.The Apache HTTP server determines that the request is for a PL/SQL stored procedure and passes it to mod_plsql.The mod_plsql module uses the information in the URL along with the configuration information in the Database Access Descriptor to determine to which Oracle user in which database it should connect. It then invokes the procedure in the database.The stored procedure runs, using the procedures in the HTTP package to write output in a buffer.The mod_plsql module returns the output in the buffer through the Apache HTTP server to the Web browser.
10Advantages and Disadvantages Within the limitations of HTML, ”everything” is possibleAll code is hand-written (Documentation? Maintainability? Quality?)Easy and fast to set upLack of integrated tools:Write HTML in HTML toolConvert to PL/SQLAdd business logic in a PL/SQL toolLeverages existing PL/SQL skills
11Oracle Designer Normal PL/SQL Web applications, i.e. HTML-based Desired functionality is modelled in the Designer tools together with the data modelDesigner PL/SQL Web Generator produces PL/SQL code from the model
12Advantages and Disadvantages High quality documentation generated automaticallySteep learning curveHigh maintainabilityDifficult to control the generated application through preferences and templatesOption to change front end (Forms, PL/SQL Web, maybe Java?)Some limitations to the applications possible
13Oracle Portal HTML-based (using PL/SQL) Browser-based: All development work is done in the browser with WizardsPortal generates PL/SQL stored procedures making extensive use of special Portal packages
14Advantages and Disadvantages Fast and easy - Power users can develop small appsStrictly limited to the functionality offered by the Portal wizardsNo client installation neededNo documentation (and no place to put documentation in the code)Also does site management and some basic DBA functions
15Oracle Forms: Getting the Forms Applet to the User
16Oracle Forms: Getting the Forms Applet to the User The user requests the first Web page of the application.The Apache HTTP server determines that the request is for a CGI program and passes the request to the mod_cgi module.The mod_cgi module starts the Forms CGI program.The Forms CGI program produces an HTML page with an instruction to load the Forms applet.The HTML page is passed back to the Web browser through the mod_cgi module and the HTTP server.The Web browser automatically requests the Forms applet from the HTTP server (and possibly the JInitiator Java plug-in).The HTTP server delivers the Forms applet (and JInitiator) to the Web browser, that starts the JVM and the applet.
18Oracle Forms: Running a Web Forms Application The Forms applet contacts the Forms Listener to start a session. This connection does not involve the Apache HTTP server in any way—it goes straight from the applet to the Forms Listener.The Forms Listener starts a Forms Runtime Engine for that client.The Forms Runtime Engine establishes a connection to the database and to the client applet.
19Advantages and Disadvantages Full control over the user interfaceNeeds a specific Java Virtual Machine (IE5 or separate plug-in to download)Leverage existing Forms skillsLonger startup time (applet download, JVM initialization)Obvious first migration path for Client/Server applicationsNeeds more hardware (Server: 10+ MB RAM per client, Client: 64+ MB RAM)
21Oracle ReportsThe user requests the report by typing in a URL or clicking a link.The HTTP server passes the request to the mod_cgi module.The mod_cgi module invokes the Reports CGI program.The Reports CGI or servlet reformats the request and passes it on to the Reports Server.The Reports Server checks whether the desired report already exists in the report cache. If the report is not in the cache, the Reports Server assigns the report to the next available Reports Runtime Engine.The Reports Runtime Engine connects to the database, retrieves and formats the data, and writes the report in the cache.The Reports Server instructs the requesting Web browser to pick up the report through the HTTP server.The Web browser requests the report from the Web server.The Web server delivers the report.
22Advantages and Disadvantages Familiar toolComplicated to control layoutProductive wizardsChoice of output formats: HTML, HTML with CSS, PDF
23Choose Your WeaponWho will be using your application? Intranet, extranet, Internet users?How complex is the user interface you need?
24Building Applet-Based Applications Using Web FormsUsing Java applets
25Building HTML-Based Applications What language skills do your developers have?Is it important to be independent of Oracle?
26Generating Applications If you can live with the user interface they offer, Oracles code-generating tools allow much higher developer productivityOracle Portal is fully browser-based: The application developer defines the application by filling in fields in a formOracle Designer is a full-featured CASE tool: The developer uses a number of development tools that work against a common repository storing a model of your application.
27Could I Have That in Writing? Printing from Java applets is tedious (and is for security reasons disabled by default)Printing from HTML gives only rudimentary control over the appearance of the printed page.PDF format allows you to produce good-looking reports in a Web browser and on paperOracle Reports can produce reports in both HTML and PDF
28SummaryHeads-down users might need a Java applet application: Use Oracle FormsCasual users and Internet users need an HTML-based applicationBuild HTML-based applications with Oracle Designer if you canYou can use either PL/SQL or Java for handwritten parts of HTML-based applications:Java is vendor independent and offers the advantages of modern object-oriented programmingPL/SQL offers unbeatable performance for database-intensive applications.Portal is promising as integration point for all applications, but not a real alternative for application development
29The Designer Approach Computer-Aided Software Engineering A Model stored in a RepositoryGenerates code at the push of a buttonMany ways to useInformation EngineeringRapid Application DevelopmentVersion Control possible
31Building Applications with Designer Logical Data DesignData/Function MappingFunction DesignTransformTransformPhysical Table DesignTable/Module MappingModule DesignDatabaseTables etc.PL/SQL packages
32Building the DatabaseWhen building the database, the end result is the same: tables in the database. But you have two ways of getting there: you can either start with an Entity-Relationship model in the E-R modeler or go directly to the Design Editor.AdvantagesDisadvantagesUsing theE-R DiagrammerDesign EditorFocus on logical designSeveral tools involvedEntire design in one stepMust code PK and FK columns
33Design CaptureReading the definition of existing database objects into the RepositoryMaking changes in DesignerGenerating a script to implement the changes
34Building an Employee List The hierarchy of objects:ModuleModule ComponentTable UsageContext items: The columns appearing on the Record List
35The Basic Employee List Without setting preferences and applying formatting, the application doesn't look very appealing
36Important Generator Preferences NameDescriptionValueCommentMODSUBSubstitute HTML Reserved CharactersNoTo allow HTML tags in user textMODALRStartup Page: About Page HyperlinkTo remove the About linkPKGLSTPL/SQL Package ListFormatThe HTML-generating pack-ages recognized by DesignerMODSFAStandard Footer on All PagesYesInstruction to use footerMODSFTStandard Footerformat.pageEndA call to the Format packageMODSHAStandard Header on All PagesInstruction to use headerMODSHDStandard Headerformat.pageStart('Module Title')
37Formatted Employee List Using a format package and a standard preference set improves the look
38Adding a Query Form Appears automatically if any items are queryable Intelligent date intervalOracle interMedia Text querying
39The Query Form for the Employee List From and To date with pop-up calendar
40Maintain Employees Continue your work on a copy Add insert, update, delete functionality to the module componentDefine operations on bound items
41Building an Employee List The hierarchy of objects:ModuleModule ComponentTable UsageLookup tables