|
Welcome Perl Programmer,
Thank you for visiting my home page. First, let me explain what
you will find
here. You will find how to develop web pages
using Object Oriented Perl programming. All the pages on
this site are produced by Perl, some of which
interact with a MySQL database.
There are many languages that can produce web pages. My
choice is Perl. Everyone has their own reasons for using a
particular language. My reasons for using Perl are simple:
My choice for the database is MySQL. The reasons I use this
database are also simple:
- It is free.
- It is nice.
- I want to know it.
In most of these pages you will see the source code, which produces
a portion of the particular page you are looking at. I have put the
code in these pages so you can see examples of the
details in action.
I also use these pages as a test case for the modules I
develop. If you see a particular page without any errors
this means the modules are working
as they are supposed to. These modules are shown on the left
side of this screen. By following these links you can learn
about them. If time permits, I intend to increase
the number of examples given in these pages.
I would like to stress two main modules OOCGI.pm, and Business.pm.
OOCGI.pm gives an Object Oriented interface to the standard CGI.pm
module.
Business.pm is the interface to the standard DBI.pm
module. This operates in such a way that each database
table becomes a business module.
You will find links to both on the left.
These are powerful modules on their own. Their real strength however,
comes with the synergy that they create when they are used together.
For example, it is
possible to create a Text (textfield) object whose content
comes from a business object.
Please look at the program
mybusines01.pl, which uses
CGI.pm and DBI.pm.
I have not used the actual
CGI.pm module in
a long time, so forgive me if the code is sloppy.
This program uses HTML syntax, database
connection code, and SQL statements. For simplicity I have omitted any
JavaScript for form validation.
In contrast, the program
mybusiness09.pl is written by using
OOCGI.pm and Business.pm. While it is
shorter, it may be somewhat cryptic to a person who is not familiar
with Object Oriented Perl programming.
This program contains no SQLs, no database
connection, no CGI param methods, and not much HTML syntax.
It is my goal to reduce the program development cycle by
hiding repetitive and complex tasks in the modules. Why
should I worry about the database connection? Why should I write
an SQL to get a simple row from a database? Why should I
write an SQL to update a row in the database? The answer to these
questions is simple. An application developer should not have to deal
with these issues. Manual programming
is error prone, difficult to maintain, and should be avoided.
I hope you find these modules as useful as I have. If you have any
comments on how I can simplify these modules,
or make them more robust please feel free to contact me.
Thanks.
OOCGI :-)
|