an improved approach to generating configuration files from a database l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
An Improved Approach to Generating Configuration Files from a Database PowerPoint Presentation
Download Presentation
An Improved Approach to Generating Configuration Files from a Database

Loading in 2 Seconds...

play fullscreen
1 / 22

An Improved Approach to Generating Configuration Files from a Database - PowerPoint PPT Presentation


  • 73 Views
  • Uploaded on

An Improved Approach to Generating Configuration Files from a Database. Jon Finke Rensselaer Polytechnic Institute. Conclusions. Cuts development time Standard development environment Host interface written once Code sharing with web routines All work done centrally

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'An Improved Approach to Generating Configuration Files from a Database' - parley


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
an improved approach to generating configuration files from a database

An Improved Approach to Generating Configuration Files from a Database

Jon Finke

Rensselaer Polytechnic Institute

conclusions
Conclusions
  • Cuts development time
    • Standard development environment
    • Host interface written once
    • Code sharing with web routines
    • All work done centrally
    • PL/SQL well integrated to Database
  • Platform independence
the old way
The Old Way
  • Custom program for each file type.
    • Common file system
    • Small number of platforms
    • Standard development environment
    • Lots of cut and paste C coding
    • Direct access to tables and views
old model

SQL*NET

SQL*NET

File Format Logic

File Format Logic

Version Control

Version Control

Old Model

Relational Database

the problems
The Problems
  • Loss of common file system
    • Harder to distribute custom programs
  • Multiple development environments
  • Program logic unavailable to web applications.
  • Minor file format changes require too much work.
new model

Relational Database

File Format Logic

File Format Logic

File Format Logic

Switcher

SQL*NET

SQL*NET

Version Control

Version Control

New Model
new way
New Way
  • File format logic stored in DB
    • Changes made centrally
  • Generic file extraction program
    • No changes after installation
    • Platform independence
  • Code sharing with web applications
  • PL/SQL programs are shorter
    • Faster to write
stored procedures and packages
Stored Procedures and Packages
  • PL/SQL
    • Procedural extension to SQL
  • Simple Procedure or Function
  • Package
    • Set of procedures and functions
    • maintains state
  • Stored and executed by database server
pl sql
PL/SQL
  • Variables and Constants
  • SQL built in functions
    • String, Numeric, Date
  • Conditionals
  • Looping Constructs
  • Exception Handling
  • Records
generic program
Generic Program

Get Filename

Start

Null?

Done

Version?

Open File

Get Line

Null?

Write Line

switcher functions
“Switcher” functions
  • Standard API for generic program
  • Provides access control
  • Provide filename for simple cases
    • Also direction, and other attributes
  • Grouping of multiple simple files
  • Environment info for specific file generator routines.
switcher
Switcher

Return

Null

Get_Filename

Record?

Get Next

Target Rec

Files>0?

Open?

Access

OK?

Return

Error

Open

Target Rec

Simple?

Return

Rec.Filename

Return

Rec.GetFname()

target record
Target Record
  • Target Name, Sequence Number
  • Access List
  • Get Data Routine Name
  • Get FileName Routine Name (C)
  • FileName (S)
  • Direction, DBMS_OUT Flag (S)
  • Version Info (S)
get data 1
Get_Data (1)

Cursor Get_Records is

Select Username, Uid Gid, Gecos, Shell, Path from Logins;

. . .

Procedure Get_Data(Result out varchar2) is

R Get_Records%RowType

begin

if not Get_Records%IsOpen

then

Open Get_Records;

end if;

get data 2
Get_Data (2)

Fetch Get_Records into R;

if Get_Records%NotFound

then

Close Get_Records;

Result := Null;

else

Result := R.Username || ‘:*:’ || R.Uid || ‘:’

|| R.Gid || ‘:’ || R.Gecos || ‘:’ || R.Path

|| ‘:’ || R.shell;

end if;

return;

complex targets
Complex Targets
  • Get_FileName
    • Like Get_Data
    • Stashes context info for Get_Data
    • Provides version info (optionally)
  • Keep calling until no more files.
  • For each file, call Get_Data until no more data.
more conclusions
More Conclusions
  • Replacing existing custom programs
  • Loading data as well as extraction
  • Handler for back end processing
    • File “STDOUT”
  • Wish I had done this long ago
package design
Package Design

File Gen

Web Server

WP File

WP Web

WP Table Routines

Relational Database Tables

files currently generated
Files Currently Generated
  • White Pages
    • LaTeX, HTML, LDIF, ph, CSV
  • Hostmaster
    • Resource Record (bind)
    • Hostfile
    • DHCP Config
  • TSM Billing
    • Error Reports
files currently loaded
Files Currently Loaded
  • TSM (Backup/archive)
    • Accounting Records
  • White Pages
    • CSV staff list (remote campus)
  • Terminal Server
    • Accounting logs
  • lpd (printing)
    • Accounting logs
futures
Futures
  • GET from program
  • PUT to program
  • Boilerplate management
  • Call file generation from Web
    • Faster development for web pages
    • Alternate Boilerplate testing
  • More platforms
an improved approach to generating configuration files from a database22

An Improved Approach to Generating Configuration Files from a Database

Jon Finke

Rensselaer Polytechnic Institute

finkej@rpi.edu

http://www.rpi.edu/~finkej