pas-dev Mailing List for Perl Application Server (Page 13)
Status: Beta
Brought to you by:
mortis
You can subscribe to this list here.
2002 |
Jan
|
Feb
(6) |
Mar
(19) |
Apr
(3) |
May
(147) |
Jun
(6) |
Jul
(4) |
Aug
(12) |
Sep
(1) |
Oct
(12) |
Nov
(23) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(4) |
Feb
(12) |
Mar
(13) |
Apr
(16) |
May
(28) |
Jun
(9) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(84) |
Dec
(25) |
2004 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
From: Kyle R . B. <mo...@vo...> - 2002-05-29 19:31:38
|
I just came across this message which discusses XSS and Python...I thought it might be of interest to us. http://groups.google.com/groups?selm=23891c90.0205240307.3eca7a57%40posting.google.com -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Justin B. <ju...@le...> - 2002-05-29 19:14:11
|
Ok. I changed the configuration parameter is pas.conf from pas.session.db.driver to pas.session.db.object. This allows a developer to create their own session DB drivers and specify in the config file where to find it. IOW, the session DB drivers are free of the Org::Bgw namespace. :) They of course will need to derive their session DB drivers from Org::Bgw::Pas::Session::Base. I'm leaving the Postgres & MySQL drivers in the repository. So can anyone test the stuff I commited and make sure it works for other people? ;) Justin |
From: Justin B. <ju...@le...> - 2002-05-29 16:54:21
|
FYI, I checked in my changes for the database sessions. I've updated: conf/sample.pas.conf I've added: src/Org/Bgw/Pas/Session/DB.pm src/Org/Bgw/Pas/Session/DBTest.pm src/Org/Bgw/Pas/Session/DB/Base.pm src/Org/Bgw/Pas/Session/DB/BaseTest.pm src/Org/Bgw/Pas/Session/DB/mysql.pm src/Org/Bgw/Pas/Session/DB/Pg.pm src/Org/Bgw/Pas/Session/DB/SessionRec.pm src/Org/Bgw/Pas/Session/DB/SessionRecTest.pm src/Org/Bgw/Pas/Session/DB/Makefile I've removed: src/Org/Bgw/Pas/Session/MySQL.pm src/Org/Bgw/Pas/Session/MySQLTest.pm src/Org/Bgw/Pas/Session/MySQL/Factory.pm src/Org/Bgw/Pas/Session/MySQL/FactoryTest.pm src/Org/Bgw/Pas/Session/MySQL/SessionRec.pm src/Org/Bgw/Pas/Session/MySQL/SessionRecTest.pm src/Org/Bgw/Pas/Session/MySQL/Makefile I tested the DB session under MySQL & Postgres and they worked for me. So far the only difference between mysql.pm & Pg.pm is the get_dsn() method. I also moved conf/log.conf to conf/sample.log.conf so there aren't any conflicts during updates (like what was done for pas.conf). I'll add more documentation later. Justin |
From: Justin B. <ju...@le...> - 2002-05-28 22:47:18
|
Kaare Rasmussen wrote: >> so I'm not sure why that isn't working. If you could >> somehow get $PAS_BASE/lib onto the PERL5LIB, then we might get a >> little further. > > > I just tried 2.0 for fun, but I will look deeper into this when I have > time. Look for a mail with at new topic... I was hoping 2.0 was available through apt-get but they're only up to 1.3.24 or something. >> Great! One of our developers is already working on session support >> for PostgreSQL, so we should have that soon. > > What is the advantage of database based sesssion support as opposed to > file based, if any? Distributed session. >> If you're only showing 50 of the records at once, then you'll only >> have 50 >> record objects in memory at once, that's not very much, and unless you're > > > I think that I'm not making myself clear. I will try to show an example. > Typically, I have a table or (more likely) a view. I want to show a list > of all rows in this view, 50 rows at a time. If the view holds 10,000 > rows, and I show 50 rows at a time, will there be 10,000 rows in my > object or 50? It all depends on how you select it from the database. I know with MySQL you can specify LIMIT in you SELECT stmts and pass it where to begin and the size block you want. So if you wanted to view the first 50 records of that view you'd do: SELECT * FROM some_table LIMIT 0,50 I would then proceed to either save in the session or in a query parameter something to indicate where I'm at in that list of 10000 records. So I can easily look at the next 50 records. Or you can load all 10000 rows into an array in an object, stuff it in the session, keep track of your index and step through the records as you would like. > can I update a view through a Perl module? As long as the DB allows it, I don't see why not. > Example: A customer is really a person or a company row joined with an > address table, joined again with a postal codes table, joined again with > a country table. > If you call the set method call for this object, should there be > something prohibiting me from updating each table with their relevant data? > Another point is, how do I make joins, aggregate functions and so on? Or > is that a no-no? Do I have to predefine each and every table combination > that I will ever use? PAS provides an architecture to develop on. You can pretty much do whatever you want on top of PAS. It doesn't limit what you can do and hopefully it makes things easier and quicker to develop. For complex queries you have to write them yourself. We do have a database record generated. What that does is generate an object that mirrors a database table. I believe we've updated PAS so that the record generator will also provide simple insert, delete & update functions for that table. If you want additional queries or need to optimize a query, our methodology for doing this is to subclass the database record object. For you're example, you'd probably want to subclass the customer record object so that it contains an address record and has a method that would call the update() methods on both the customer record object & the address record object. >>> For Freemoney (the Financial App), I need at least Menus (see demo) >>> and Login and Access handling. >> >> I'd think Pas could handle that :) > > > Ah, but this is one of the points where I'm not satisfied with the > current solutions that I can find. Login and Access handling shoule > really be named Security. And security is not something that can be > bolted on at the end, if you want a good solution, and Apache's > .htpasswd is not fine grained enough. > And a menu system should be integrated with the security. > Scenario: > A user logs in to the system. It's not a Linux-user, just a user stored > somewhere in this system. > The user is presented with a menu. It is a multi-layer menu. Either like > Freemoney today, where choosing a main menu will display sub menus, or a > tree structure. > The user is only presented with the menu options that are allowed for > this user. > Maybe in another scenario, it will be a series of links. Again, of > course, only the links that this user is allowed to see. > All this has to be mandatory for a site. Maybe meaning that it has to be > a setting in startup.pl or in httpd.conf. You can do this with a properties table or addition columns in the user profile table that complements the standard user information. When a user logs in, along with their standard information you load in their property information and stick it in the session. Then at the beginning of each PSP page, you can check to see if the user has that specific property. If they do, they can view the page. If they don't, they get a page that says they have entered a restricted area. You make these properties read-only for the users and only configurable by an administrator. You can do this for a whole page or specfic links. Or a more basic example, only certain users can view a page once they are logged in. In the past, we've had our standard page object for displaying a page and then we'd have a LoggedInPage object (which was dervived from the standard page object) for first checking if the user is logged in (by checking the session) and then displaying the page if they are. This is a more cleaner way to check a user's properties instead of having the business logic (if stmts) inside the PSP pages. Hope that answers your questions. Justin |
From: Justin B. <ju...@le...> - 2002-05-28 22:04:26
|
>>>Yes, and in your config file, you specify what child of these classes to >>>use, correct? So you'd be setting >>>pas.session.object=Org::Bgw::Pas::Session::Db::Pg or something right? >> >>Pretty much. Every so slightly different. Org::Bgw::Pas::Session::DB >>determines the correct object to use by what's in the config file. Right now >>it's reading the variable pas.session.db.driver from the config file. > > A parent knowing about its children strikes me as bad. Shouldnt the > config file tell pas what session object to use for sessions? Then pas > instantiates a session of type N and uses it. Org::Bgw::Pas::Session::DB isn't a parent object, it's an implementation of the session interface with a factory method to create the object for the DB backend and then delegates to it. Like I said in a previous discussion, the name can be a little confusing. So, naming convention aside, I believe it does what you're talking about. >>So you pas.session.object will only be valid for the following session types: >>File, DB or Apache. So if you set pas.session.object to DB, the >>pas.session.db.driver tells the application what kind of DB the session will be >>connecting to. > > I think we need 2 settings in the config, DB type (file, apache, rdb) > and session type so that we use the right loader/storer stuff. We have that. pas.session.object is for the session type and pas.session.db.driver determines the right DB to use. >>>>Small modifications to Org::Bgw::Pas::Session::DB and a new class of >>>>Org::Bgw::Pas::Session::DB::mysql was all that was needed. >>>> >>>>And I guess I should write some unit tests before commiting. ;) I'd also like >>>>to commit the Postgresql implementation at the same time. I have to remember >>>>how to configure Postgresql. >>> >>>Actually, its not hard. And since its new, it doesnt matter. Just make >>>sure you dont break mysql and commit what you have. I have postgres >>>setup and can test/tweak and write tests for that piece if you want. Or >>>I can create you an account on hades and you can do stuff there. >> >>What I meant by configuring is setting up users and then setting passwords & >>privileges. It's been too long since I've used Postgresql. It's just a matter >>of finding the right page in the manual. I've created a user, a database and >>the pas_session table. I'm not sure if I have a password or the privileges >>right yet. I may also need to upgrade to 7.1 or 7.2 (I'm running 7.0.3 right now). > > That really depends. YOu can configure it so that anything that connects > to the local box is trusted. This is independent of tcp connections. Its > all in the user/admin guide. vi /etc/postgresql/pg_hba.conf I wanted it to connect just like MySQL with a user name and password. I didn't want to do a trusted user. Like I said, it's been a while but I found it. I now have an instance of PAS working with Postgresql 7.0.3. I'm sure if my session gets large enough (>8k?) I'll crash it unless I upgrade to at least 7.1. >>>The way I see this working is that we simply provide a way to get >>>sessions working in the app. I dont see the DB layer ever doing anything >>>more. Then developers can write their own page object in pas/pages (or >>>wherever) that connects to their X database. They would derive from this >>>OtherDatabase class for their other page objects. This is probably the >>>most non-invasive/easist way to go. Sessions and other data dont even >>>need to be in the same db at that point. Forgive me if I'm stating the >>>obvious, but we may want to add some note to this effect in our docs if >>>there isnt one already. >> >>I guess if we want to go this way, we'd need to change the config file parameter >>to something closer to what you suggested. Then people can add the different DB >> session classes outside the Org::Bgw namespace. > > Why do they need to use our config file at all? And what would prevent > them from adding an entry and using it as things stand now? They don't have to use our config file. They'd have to set these parameter in their own config file if they want it to work tho. What prevents them from adding an entry and using it as things stand now is that the session is tied to either type: File, Apache or Mysql. There is no option to use Postgresql or Oracle to store the session in a DB. After my mods, they won't be tied down. >>But I also think it would be good if we could provide support for as many >>databases as possible (session & other wise). Then at least we can sound kewl >>and can word salad people with large lists!! > > So should we have an Org::Bgw::Pas::Db object that you can use to get a > generic_dbh? > > What if you have 5 different data sources? I think we should make it > easy to extend after we get the session stuff sorted out. Probably, but I think you're going beyond the scope of this modification. ;) Justin |
From: Mental <me...@ne...> - 2002-05-28 20:39:35
|
On Tue, 2002-05-28 at 16:02, Justin Bedard wrote: > > Yes, and in your config file, you specify what child of these classes to > > use, correct? So you'd be setting > > pas.session.object=Org::Bgw::Pas::Session::Db::Pg or something right? > > Pretty much. Every so slightly different. Org::Bgw::Pas::Session::DB > determines the correct object to use by what's in the config file. Right now > it's reading the variable pas.session.db.driver from the config file. > A parent knowing about its children strikes me as bad. Shouldnt the config file tell pas what session object to use for sessions? Then pas instantiates a session of type N and uses it. > So you pas.session.object will only be valid for the following session types: > File, DB or Apache. So if you set pas.session.object to DB, the > pas.session.db.driver tells the application what kind of DB the session will be > connecting to. > I think we need 2 settings in the config, DB type (file, apache, rdb) and session type so that we use the right loader/storer stuff. > >>Small modifications to Org::Bgw::Pas::Session::DB and a new class of > >>Org::Bgw::Pas::Session::DB::mysql was all that was needed. > >> > >>And I guess I should write some unit tests before commiting. ;) I'd also like > >>to commit the Postgresql implementation at the same time. I have to remember > >>how to configure Postgresql. > > > > Actually, its not hard. And since its new, it doesnt matter. Just make > > sure you dont break mysql and commit what you have. I have postgres > > setup and can test/tweak and write tests for that piece if you want. Or > > I can create you an account on hades and you can do stuff there. > > What I meant by configuring is setting up users and then setting passwords & > privileges. It's been too long since I've used Postgresql. It's just a matter > of finding the right page in the manual. I've created a user, a database and > the pas_session table. I'm not sure if I have a password or the privileges > right yet. I may also need to upgrade to 7.1 or 7.2 (I'm running 7.0.3 right now). > That really depends. YOu can configure it so that anything that connects to the local box is trusted. This is independent of tcp connections. Its all in the user/admin guide. vi /etc/postgresql/pg_hba.conf > > The way I see this working is that we simply provide a way to get > > sessions working in the app. I dont see the DB layer ever doing anything > > more. Then developers can write their own page object in pas/pages (or > > wherever) that connects to their X database. They would derive from this > > OtherDatabase class for their other page objects. This is probably the > > most non-invasive/easist way to go. Sessions and other data dont even > > need to be in the same db at that point. Forgive me if I'm stating the > > obvious, but we may want to add some note to this effect in our docs if > > there isnt one already. > > I guess if we want to go this way, we'd need to change the config file parameter > to something closer to what you suggested. Then people can add the different DB > session classes outside the Org::Bgw namespace. > Why do they need to use our config file at all? And what would prevent them from adding an entry and using it as things stand now? > But I also think it would be good if we could provide support for as many > databases as possible (session & other wise). Then at least we can sound kewl > and can word salad people with large lists!! So should we have an Org::Bgw::Pas::Db object that you can use to get a generic_dbh? What if you have 5 different data sources? I think we should make it easy to extend after we get the session stuff sorted out. -- Mental (Me...@Ne...) |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 20:08:43
|
> > I've got the clickable image maps working...to get the coords right, you > > have to have dot generate pngs. This made some of the code easier as > > well. > > > > You also have to have a bunch of true type fonts to get dot to emit a > > good looking (and correct) png image. > > > > Hey. How difficult would it be to teach doxygen perl? That, ultimately would be the right approach. In fact, they have Perl listed in their TODO: http://www.stack.nl/~dimitri/doxygen/todo.html about a third of the way down the page. There are a few issues with this though. In Perl, there are packages. An object is a perl package into which a reference has been blessed. In OO, a Class is a description of a type of object. So what's a Class in Perl? In C++ or Java, that's easy, its the definition in the source code. But what is it in Perl? What's the difference between a module and a class in Perl? Doxygen parses the source code (C++ and Java) to do it's job. To do this with Perl is alot harder. POD does not map cleanly, or very well at all, to the types of constructs that Doxygen expects and needs. What is the standard method documentation in POD? There is none. What is the standard parameter documentation? None. Also, POD is often used by lazy programmers for multi-line comments, which Doxygen would have to figure out how to ignore. To make it work you'd have to define something larger/better than POD and use it. We can do that, and if we stick to it, we could then probably write a compatability layer with Doxygen. The only thing DocWeb has over Doxygen is its dynamic, interactive nature. > Just askin. I've never really used it. I have and I really like it. That's basicly where I got the idea for the DocWeb module from. Have you tried it out on any of your other sources yet? It should work for just about everything... k -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Justin B. <ju...@le...> - 2002-05-28 20:02:43
|
>>>>So far, here's my design hack to allow PAS to use other DBs besides MySQL for >>>>it's session. Here's just the package name, the @ISA and the method names: >>> >>>Cool. It looks similar to the road I was going down. I started today on >>>a generic Session and Factory object. The SessionRec can be thrown out >>>and created with one makeGetSetScalar call and reused on any db so long >>>as the column names match. >> >>Yup. >> >> >>>I spaced on a few things and find myself backtracking to fix them. It >>>looks like you're ahead of me. I didnt know you were working on this >>>actively or I'd have mailed you about it. >> >>I was sorta hesitent because I didn't think there was any final approval. I >>think there's more of a hang up on how the whole session is implemented then any >>particular part but it was enough for me to hold off. When it was mentioned >>recently that someone was working on it, I continued down my path. > > Well, originally I was going to just clone mysql stuff and make it work > with postgres. I got pretty far with it, but it was just.... wasteful to > duplicate all that code. Thats when I re-read your proposal and just > started doing it. Your way is much better IMHO. Duplicating all that code == bad. :) >>>I was looking into modifying how session.pm worked to just pick the >>>right kind of object to require and create. Thats about when I realized >>>that the container to use was a config file entry, and backed out a few >>>changes. >> >>Ah. >> >> >>>I guess I'll wait for you to either commit what you have or finish it >>>off. >> >>Well, if people like what I have so far, I'll commit it. >> >>More or less my solution just does a little shuffling: >> >>Org::Bgw::Pas::Session::MySQL -> Org::Bgw::Pas::Session::DB >>Org::Bgw::Pas::Session::MySQL::Factory -> Org::Bgw::Pas::Session::DB::Base > > Yes, and in your config file, you specify what child of these classes to > use, correct? So you'd be setting > pas.session.object=Org::Bgw::Pas::Session::Db::Pg or something right? Pretty much. Every so slightly different. Org::Bgw::Pas::Session::DB determines the correct object to use by what's in the config file. Right now it's reading the variable pas.session.db.driver from the config file. So you pas.session.object will only be valid for the following session types: File, DB or Apache. So if you set pas.session.object to DB, the pas.session.db.driver tells the application what kind of DB the session will be connecting to. >>Small modifications to Org::Bgw::Pas::Session::DB and a new class of >>Org::Bgw::Pas::Session::DB::mysql was all that was needed. >> >>And I guess I should write some unit tests before commiting. ;) I'd also like >>to commit the Postgresql implementation at the same time. I have to remember >>how to configure Postgresql. > > Actually, its not hard. And since its new, it doesnt matter. Just make > sure you dont break mysql and commit what you have. I have postgres > setup and can test/tweak and write tests for that piece if you want. Or > I can create you an account on hades and you can do stuff there. What I meant by configuring is setting up users and then setting passwords & privileges. It's been too long since I've used Postgresql. It's just a matter of finding the right page in the manual. I've created a user, a database and the pas_session table. I'm not sure if I have a password or the privileges right yet. I may also need to upgrade to 7.1 or 7.2 (I'm running 7.0.3 right now). > The way I see this working is that we simply provide a way to get > sessions working in the app. I dont see the DB layer ever doing anything > more. Then developers can write their own page object in pas/pages (or > wherever) that connects to their X database. They would derive from this > OtherDatabase class for their other page objects. This is probably the > most non-invasive/easist way to go. Sessions and other data dont even > need to be in the same db at that point. Forgive me if I'm stating the > obvious, but we may want to add some note to this effect in our docs if > there isnt one already. I guess if we want to go this way, we'd need to change the config file parameter to something closer to what you suggested. Then people can add the different DB session classes outside the Org::Bgw namespace. But I also think it would be good if we could provide support for as many databases as possible (session & other wise). Then at least we can sound kewl and can word salad people with large lists!! Justin |
From: Mental <me...@ne...> - 2002-05-28 19:57:11
|
On Tue, 2002-05-28 at 15:42, Kyle R . Burton wrote: > I've got the clickable image maps working...to get the coords right, you > have to have dot generate pngs. This made some of the code easier as > well. > > You also have to have a bunch of true type fonts to get dot to emit a > good looking (and correct) png image. > Hey. How difficult would it be to teach doxygen perl? Just askin. I've never really used it. -- Mental (Me...@Ne...) |
From: Mental <me...@ne...> - 2002-05-28 19:42:37
|
On Tue, 2002-05-28 at 15:14, Justin Bedard wrote: > > >>So far, here's my design hack to allow PAS to use other DBs besides MySQL for > >>it's session. Here's just the package name, the @ISA and the method names: > > > > Cool. It looks similar to the road I was going down. I started today on > > a generic Session and Factory object. The SessionRec can be thrown out > > and created with one makeGetSetScalar call and reused on any db so long > > as the column names match. > > Yup. > > > I spaced on a few things and find myself backtracking to fix them. It > > looks like you're ahead of me. I didnt know you were working on this > > actively or I'd have mailed you about it. > > I was sorta hesitent because I didn't think there was any final approval. I > think there's more of a hang up on how the whole session is implemented then any > particular part but it was enough for me to hold off. When it was mentioned > recently that someone was working on it, I continued down my path. > Well, originally I was going to just clone mysql stuff and make it work with postgres. I got pretty far with it, but it was just.... wasteful to duplicate all that code. Thats when I re-read your proposal and just started doing it. Your way is much better IMHO. > > I was looking into modifying how session.pm worked to just pick the > > right kind of object to require and create. Thats about when I realized > > that the container to use was a config file entry, and backed out a few > > changes. > > Ah. > > > I guess I'll wait for you to either commit what you have or finish it > > off. > > Well, if people like what I have so far, I'll commit it. > > More or less my solution just does a little shuffling: > > Org::Bgw::Pas::Session::MySQL -> Org::Bgw::Pas::Session::DB > Org::Bgw::Pas::Session::MySQL::Factory -> Org::Bgw::Pas::Session::DB::Base > Yes, and in your config file, you specify what child of these classes to use, correct? So you'd be setting pas.session.object=Org::Bgw::Pas::Session::Db::Pg or something right? > Small modifications to Org::Bgw::Pas::Session::DB and a new class of > Org::Bgw::Pas::Session::DB::mysql was all that was needed. > > And I guess I should write some unit tests before commiting. ;) I'd also like > to commit the Postgresql implementation at the same time. I have to remember > how to configure Postgresql. > Actually, its not hard. And since its new, it doesnt matter. Just make sure you dont break mysql and commit what you have. I have postgres setup and can test/tweak and write tests for that piece if you want. Or I can create you an account on hades and you can do stuff there. The way I see this working is that we simply provide a way to get sessions working in the app. I dont see the DB layer ever doing anything more. Then developers can write their own page object in pas/pages (or wherever) that connects to their X database. They would derive from this OtherDatabase class for their other page objects. This is probably the most non-invasive/easist way to go. Sessions and other data dont even need to be in the same db at that point. Forgive me if I'm stating the obvious, but we may want to add some note to this effect in our docs if there isnt one already. -- Mental (Me...@Ne...) |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 19:42:32
|
I've got the clickable image maps working...to get the coords right, you have to have dot generate pngs. This made some of the code easier as well. You also have to have a bunch of true type fonts to get dot to emit a good looking (and correct) png image. I can see quite a few directions to go with the docWeb module... - show collaboration diagrams [any modules that are 'used' from the module in question should be listed in this way]. - list direct known child classes, not just parents. We can figure this out if we build a tree from the entire soruce base -- so maybe that's something we do, but cache in the file system somewhere, kind of like when you bild your ctags file... - use an image-cache (maybe in the psp-cache directory?) to cache generated png images to speed things up. That does raise the issue of dependency checking with your parent's source files though. - can/should we extend, or roll our own, POD to get closer to what Doxygen and Javadoc profides? Doxygen warns you about undocumented methods. They both include documentation for the function as well as specific parameter descriptions and return value documentation. . using that as a jumping board, we could generate docbook and from there generate ps and pdf - like Doxygen does...that'd make it easy to print an API manual directly from the source doc comments - more hyperlinks between the modules to make things a bit more browsable. Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Justin B. <ju...@le...> - 2002-05-28 19:15:12
|
>>So far, here's my design hack to allow PAS to use other DBs besides MySQL for >>it's session. Here's just the package name, the @ISA and the method names: > > Cool. It looks similar to the road I was going down. I started today on > a generic Session and Factory object. The SessionRec can be thrown out > and created with one makeGetSetScalar call and reused on any db so long > as the column names match. Yup. > I spaced on a few things and find myself backtracking to fix them. It > looks like you're ahead of me. I didnt know you were working on this > actively or I'd have mailed you about it. I was sorta hesitent because I didn't think there was any final approval. I think there's more of a hang up on how the whole session is implemented then any particular part but it was enough for me to hold off. When it was mentioned recently that someone was working on it, I continued down my path. > I was looking into modifying how session.pm worked to just pick the > right kind of object to require and create. Thats about when I realized > that the container to use was a config file entry, and backed out a few > changes. Ah. > I guess I'll wait for you to either commit what you have or finish it > off. Well, if people like what I have so far, I'll commit it. More or less my solution just does a little shuffling: Org::Bgw::Pas::Session::MySQL -> Org::Bgw::Pas::Session::DB Org::Bgw::Pas::Session::MySQL::Factory -> Org::Bgw::Pas::Session::DB::Base Small modifications to Org::Bgw::Pas::Session::DB and a new class of Org::Bgw::Pas::Session::DB::mysql was all that was needed. And I guess I should write some unit tests before commiting. ;) I'd also like to commit the Postgresql implementation at the same time. I have to remember how to configure Postgresql. Justin |
From: Mental <me...@ne...> - 2002-05-28 18:51:17
|
On Tue, 2002-05-28 at 14:33, Justin Bedard wrote: > > So far, here's my design hack to allow PAS to use other DBs besides MySQL for > it's session. Here's just the package name, the @ISA and the method names: Cool. It looks similar to the road I was going down. I started today on a generic Session and Factory object. The SessionRec can be thrown out and created with one makeGetSetScalar call and reused on any db so long as the column names match. I spaced on a few things and find myself backtracking to fix them. It looks like you're ahead of me. I didnt know you were working on this actively or I'd have mailed you about it. I was looking into modifying how session.pm worked to just pick the right kind of object to require and create. Thats about when I realized that the container to use was a config file entry, and backed out a few changes. I guess I'll wait for you to either commit what you have or finish it off. -- Mental (Me...@Ne...) |
From: Mental <me...@ne...> - 2002-05-28 18:42:05
|
On Tue, 2002-05-28 at 14:32, Kyle R . Burton wrote: > > What is the advantage of database based sesssion support as opposed to file > > based, if any? > > Distribution and load balancing. File based sessions can not easily be > used in a configuraiton where you have more than 1 webserver. In a > typical load balanced configuration, a specific user's request might > hit any one of the web servers in the cluster. So that their session > data is available to all of the web servers in the cluster, it needs to > be stored centraly. File based sessions don't really scale up very > well - you can use an NFS, or Samba mounted volume that is shared > acrsoss the webservers, but that doesn't perform very well. Database > based sessions are more appropraite for use by a cluster of web > servers. I'll chime in and recommend not using NFS or samba. File locking becomes a problem. Especially under load. Thats all. -- Mental (Me...@Ne...) |
From: Justin B. <ju...@le...> - 2002-05-28 18:34:20
|
So far, here's my design hack to allow PAS to use other DBs besides MySQL for it's session. Here's just the package name, the @ISA and the method names: ---------------------------------------------------------------------------- package Org::Bgw::Pas::Session::Db our @ISA = qw(Org::Bgw::Pas::Session Org::Bgw::Db::Base Org::Bgw::Pas::Session::DB::SessionRec); sub read_from_storage sub write_to_storage sub get_timestamp sub update_timestamp sub _session_factory sub _factory --------------------------------------------------------------------------- package Org::Bgw::Pas::Session::DbFactory sub getDbPackage() {} --------------------------------------------------------------------------- package Org::Bgw::Pas::Session::DB::SessionRec # hasn't changed; only moved it's location --------------------------------------------------------------------------- package Org::Bgw::Pas::Session::DB::DB our @ISA = qw(Org::Bgw::Pas::Session Org::Bgw::Db::Base); sub verify_settings sub db_driver sub db_dsn sub db_hostname sub db_dbname sub db_table sub get_username sub get_password sub get_dsn sub load_session_rec sub update_session_rec sub store_session_rec sub insert_session_rec sub update_atime_for_session_rec sub _insert_sql sub _update_sql sub _select_sql sub _update_timestamp_sql ---------------------------------------------------------------------------- package Org::Bgw::Pas::Session::DB::mysql our @ISA = qw(Org::Bgw::Db::Base Org::Bgw::Pas::Session::DB::DB); sub get_dsn ---------------------------------------------------------------------------- And that's it. I have it working for MySQL. I've been looking to get it to work under Postgresql. Looks like if we use version >=7.1 of Postgresql, we're not going to run into any problems with the large data field of the session. The newer Postgresql have a limit of 1GB for text fields. That's more then enough. And because of this, all we may need to override is get_dsn() like the MySQL DB session object. If not, it's easy enough to override the insert, update or select. I'm also thinking of combining Org::Bgw::Pas::Session::DB & Org::Bgw::Pas::Session::DbFactory. The original thought of having them separate was because I thought I'd have a bunch of if/else statements to determine which DB session object I wanted to load. I solved this by naming my DB session object the same way DBI/DBD expects it. If you do a perldoc on DBI and look at the section "Driver Specific Prefix Registry" it list MySQL as DBD::mysql. So drop the DBD and you have your naming convention. Therefore, for a Postgresql DB session object, it will be named Pg.pm and for Oracle, Oracle.pm. Does this make sense or should we use the fully quantified DB names? MySQL, PostgreSQL, etc? Also, if I was to combine the 2 classes mentioned above, should I name it Org::Bgw::Pas::Session::DB (so it's consistant with Org::Bgw::Pas::Session::File) or name it Org::Bgw::Pas::Session::DbFactory? It really is a factory object logically but the person that configures the pas.conf file doesn't care. They just want a File based session or a DB base session. My vote is to name it DB. And I guess I should rename Org::Bgw::Pas::Session::DB::DB to Org::Bgw::Pas::Session::DB::Base. Any thoughts? Justin |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 18:32:31
|
> What is the advantage of database based sesssion support as opposed to file > based, if any? Distribution and load balancing. File based sessions can not easily be used in a configuraiton where you have more than 1 webserver. In a typical load balanced configuration, a specific user's request might hit any one of the web servers in the cluster. So that their session data is available to all of the web servers in the cluster, it needs to be stored centraly. File based sessions don't really scale up very well - you can use an NFS, or Samba mounted volume that is shared acrsoss the webservers, but that doesn't perform very well. Database based sessions are more appropraite for use by a cluster of web servers. Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Kaare R. <ka...@ka...> - 2002-05-28 18:19:55
|
> so I'm not sure why that isn't working. If you could > somehow get $PAS_BASE/lib onto the PERL5LIB, then we might get a little > further. I just tried 2.0 for fun, but I will look deeper into this when I have time. Look for a mail with at new topic... > Great! One of our developers is already working on session support for > PostgreSQL, so we should have that soon. What is the advantage of database based sesssion support as opposed to file based, if any? > If you're only showing 50 of the records at once, then you'll only have 50 > record objects in memory at once, that's not very much, and unless you're I think that I'm not making myself clear. I will try to show an example. Typically, I have a table or (more likely) a view. I want to show a list of all rows in this view, 50 rows at a time. If the view holds 10,000 rows, and I show 50 rows at a time, will there be 10,000 rows in my object or 50? can I update a view through a Perl module? Example: A customer is really a person or a company row joined with an address table, joined again with a postal codes table, joined again with a country table. If you call the set method call for this object, should there be something prohibiting me from updating each table with their relevant data? Another point is, how do I make joins, aggregate functions and so on? Or is that a no-no? Do I have to predefine each and every table combination that I will ever use? >> For Freemoney (the Financial App), I need at least Menus (see demo) and Login >> and Access handling. > I'd think Pas could handle that :) Ah, but this is one of the points where I'm not satisfied with the current solutions that I can find. Login and Access handling shoule really be named Security. And security is not something that can be bolted on at the end, if you want a good solution, and Apache's .htpasswd is not fine grained enough. And a menu system should be integrated with the security. Scenario: A user logs in to the system. It's not a Linux-user, just a user stored somewhere in this system. The user is presented with a menu. It is a multi-layer menu. Either like Freemoney today, where choosing a main menu will display sub menus, or a tree structure. The user is only presented with the menu options that are allowed for this user. Maybe in another scenario, it will be a series of links. Again, of course, only the links that this user is allowed to see. All this has to be mandatory for a site. Maybe meaning that it has to be a setting in startup.pl or in httpd.conf. Well, to busy now to elaborate on a solution :-) -- Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 Kaki Data tshirts, merchandize Fax: 3816 2501 Howitzvej 75 Åben 14.00-18.00 Web: www.suse.dk 2000 Frederiksberg Lørdag 11.00-17.00 Email: ka...@ka... |
From: Justin B. <ju...@le...> - 2002-05-28 17:10:52
|
I think I found a bug in Org::Bgw::Db::Base: sub copy_result_set_to_object { my($self,$ar,$obj) = @_; my $i = 0; foreach my $meth (@_) { $self->log()->debug("meth = '$meth'"); $self->log()->debug("ar->[$i] = $ar->[$i]"); $obj->$meth($ar->[$i++]); } return 1; } Doesn't work too well when called from Org::Bgw::Pas::Session::MySQL::Factory->load_session_rec(). It was changed on 5/20/02 to the above from: sub copy_result_set_to_object { my $self = shift; my $ar = shift; my $obj = shift; my $i = 0; foreach my $meth (@_) { $self->log()->debug("meth = '$meth'"); $self->log()->debug("ar->[$i] = $ar->[$i]"); $obj->$meth($ar->[$i++]); } return 1; } If you look at the for loop and load_session_rec(), it becomes obvious why you need the shifts in there. I'm going to check this in. Justin |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 14:30:08
|
Hey, if you guys get a chance, and can get it running, try out the docWeb example...it's the beginning of a Doxygen like, on-line, dynamcily generated, inheritence graph-included, documentation system...works for any module you have installed...though it only starts by looking at what's in your %INC, it can work with any moudle that it can 'use', just futz with the 'module' query parameter. You have to have dot [graphviz] and convert [image magic] installed. I think it assumes convert [image magic] is assumed to be part of your path, but dot's path is based on a config param. I'm having a tough time figuring out how to get dot to generate the html image map data correctly...if that worked, it'd be alot more useful. I think it has potential...but that's just me. Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Justin B. <ju...@le...> - 2002-05-28 05:21:47
|
Kyle R . Burton wrote: >>I've been having problems with included files today. I recently updated my PAS >>directory and none of the included files were showing up. I tracked it down to >>inside resolve_includes(). I changed this: >> >> $file = >>$ENV{'PAS_BASE'}.'/'.$self->config()->get('pas.documentRoot').'/'.$file; >> >> >>to this: >> >> $file = $self->config()->get('pas.documentRoot').'/'.$file; >> > > That's part of this block, right?: > > unless('/' eq substr($file,0,1)) { > $file = $self->pwd().'/'.$file; > } > else { > $file = $ENV{'PAS_BASE'}.'/'.$self->config()->get('pas.documentRoot').'/'.$file; > } > > I think the point of that if/else (ok, unless/else) is to use the file path > as specified, if it is an absolute path (starts with a '/'), otherwise, > assume it's pathed the document root. Hmmm... the example here is: <%include file="/_stdPageHeader.psp" %> I want to include a standard page header from the document root. That file is understood to be in the document root. Since my document root is fully pathed and not under PAS_BASE, the logic is flawed, which we agree on. If I don't have that '/' in there, then were are in the first part of the unless block. Hmmm... that part is not giving me warm fuzzies right now. It seems like I could create a PSP file outside of PAS's document root and execute it if I wanted to. True? Not true? Shouldn't all PSP files only come from inside the pas.documentRoot for security reasons?? Looking at the code, it looks very possible. Of course, it's 1:20am right now. Also, you might want to change this stuff: $self->log()->debug("computing pwd from: $file\n") if $debug; With Log::Dispatch you don't need the 'if $debug' at the end of the stmt anymore. > The problem is obviously in the else block -- we need to check the value > of pas.documentRoot to see if it starts with a '/', and prefix it with > PAS_BASE otherwise. > > Maybe this should be a function in the Environment package? Do we already > have a method that returns the document root somewhere? Maybe we should > add the proper logic to it, and then update the line above to use it. I dunno. Sounds like you're trying to over-compensate for someone that doesn't fully path their pas.documentRoot. You set the DocumentRoot in Apache, that's were it better be on the file system! Apache isn't going to try to compensate. If they want to do it relatively, let them in the conf file: pas.documentRoot=$ENV{'PAS_BASE'}.'/htdocs'; >>And it works. On another box (internal production environment), we have version >>1.12 of the Compiler.pm checked out and it works fine. Actually, it looks like >>we had a similar problem back then: >> >> #$file = $ENV{'PAS_BASE'}.'/'.$self->config()->get('pas.documentRoot').'/'.$file; >> $file = $self->config()->get('pas.documentRoot').'/'.$file; >> >>It was solved the same exact way. However, mortis checked it in with the >>$ENV{'PAS_BASE'} for 1.13 (we're on 1.19 in case anyone is wondering). >> >>I guess we have to figure out how were're going to do this. I think it should >>be off of pas.documentRoot. I don't know why $ENV{'PAS_BASE'} is in there. >> > > PAS_BASE is there, becuase we want the flexibility for the the doc root to > be either relative to PAS_BASE, or absolutely pathed. How would you guys > like to do this? Throw out the relatively pathed thing. I think it can only confuse the code, confuse the person configuring PAS and can cause bugs when you place the pas.documentRoot outside of PAS_BASE (unless we fix the code but see points 1 & 2). At this time, I can't think of anything it really buys us. Justin |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 01:29:09
|
> Get the pas.conf OUT of cvs! > > Rename it to pas.conf.sample. It gets in the way when upgrading between > releases. The whole world will not want their conf file in cvs :) Just > give a sample that can be built on. That way it'll be a little easier to > import this stuff into your other projects that use it. > > comments? Done. I updated the INSTALL file to tell users to copy the sample.pas.conf to pas.conf and then edit it. It will no longer fuxor up your stuff. And the fact that it's a sample config file is now explicit. Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 00:27:04
|
> No, Apache 2 + mod_perl 2 won't even start: > > [Fri May 24 23:34:26 2002] [error] Can't load Perl file: > /home/pas/src/startup.pl for server namer.webline.dk:0, exiting... > > [Mon May 27 21:52:13 2002] [error] Can't locate Org/Bgw/Config.pm in @INC > (@INC > contains: /src /usr/lib/perl5/5.6.1/i586-linux /usr/lib/perl5/5.6.1 > /usr/lib/perl5/site_perl/5.6.1/i586-linux /usr/lib/perl5/site_perl/5.6.1 > /usr/lib/perl5/site_perl .) at /home/pas/src/startup.pl line 5. > > I guess that > > PerlSetEnv PAS_BASE "/home/pas" > > doesn't work in 2.0. I believe there is some sort of compatibility thing, but > I haven't had the time to try it out. I think the particular error there is because the $PAS_BASE/lib directory isn't in Perl's @INC (it's path). The startup.pl does try to set that up automaticly though, so I'm not sure why that isn't working. If you could somehow get $PAS_BASE/lib onto the PERL5LIB, then we might get a little further. > Why don't you add more elaborate examples? Just a suggestion - it will attact > more people. I think we plan to, we just haven't had the time, or the ideas for more examples yet. > Already using PostgreSQL extensively. For Freemoney, it's a requirement. Great! One of our developers is already working on session support for PostgreSQL, so we should have that soon. > Some kind of binding to a hash or something would be nice. I need the ability > to list a lot of rows without too much overhead. The rows need to be listed > x at a time. > Say I have 1000 customers. I'd like to have an overview of 50, with the > ability to page forward, backward, to the top or bottom, and maybe select > between the next 20 pages. > I think that EmbPerl had a nice idea there, but I'm not sure. Perl's objects are typicly based on hash references, so there isn't much memory overhead for an object over a hash reference. A method call to perform a get or a set for a member variable is more time overhead than straight hash references, _but_ you pay a price when it comes to debugging your code. A typo in a hash key gets you an undefined value, while a typo with a method call gets you an exception, which is alot easier to track down, you know exactly where it happened, and it doesn't propigate bad data to other parts of the codebase. Also, since web based applications are not typicly very CPU intensive, and the additional overhead is negligable, you probably won't notice it even under high loads. One of the features we're talking about adding into the object generator (perhaps as an optional feature) is to have type and length checking during the set call to verify that the value is valid for the database column. That is something that can't be easily done with a hash. > This is a demo of Freemoney. User / password is demo / pass: > http://www.web-counting.com/cgi-bin/DanskDemo/process/locale/da_DK/freemoney/index.html > > But I can see that it's not really working. I have to call the manager of > that site. Sigh! > But the idea is to present a list of customers, products, orders and so on. > Be able to sort them in some way. Select one and update/remove it. Or do some > other processing. If you're only showing 50 of the records at once, then you'll only have 50 record objects in memory at once, that's not very much, and unless you're running the software on a low memory box (<128mb), you probably won't notice. Perl is fast, more than enough for web applications. > > We usualy develop the business logic in Page objects. You can produce > > HTML pages from page objects, but there is no need to. We develop > > But maybe this functionality will be used in other applications. So it's best > to out in modules. Or a combination. Yes, a combination would probably be the most appropriate. It depends on your circumstances though. > There still is a long way, and I'm only looking. My plan is to try Pas for > the Freemoney project page. Why don't you use Pas for Pas' own project page? The primary reason is because the website is hosted by SourceForge, and they don't support mod_perl. Most sitest that host more than 1 domain on a single webserver don't support mod_perl. Resources and namespace collision are two reasons that it's usualy not economical for them. > For Freemoney (the Financial App), I need at least Menus (see demo) and Login > and Access handling. I'd think Pas could handle that :) Thanks again for your interest. Kyle R. Burton -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Kyle R . B. <mo...@vo...> - 2002-05-28 00:08:21
|
Originaly, in the error_page method of the request handler, we had: my $self = shift; I chagned that to: my($self) = @_; because it's faster. The problem was, a few lines down from there, we also had: $self->page()->exception(shift()); Which was putting $self into exception(), so that what was showing up in the exception page! I changed those lines to: my($self,@exception) = @_; ... $self->page()->exception(@exception); So now it reports the error (which was descriptive of the problem to begin with!): Exception: Error creating path: //home/mortis/projects/pas/psp-cache/Org : Permission denied If you want to use dynamic re-compilation of psp pages, please make sure your web server has write access to the psp-cahce directory specified in your pas.conf file. Org::Bgw::Exception->Org::Bgw::Exception::_build_stack_trace(@_) called from: /home/mortis/projects/pas/src/Org/Bgw/Exception.pm line 53 operating system error[13]: Permission denied sigh. That one was completely my fault. It's in the current HEAD of CVS for anyone who's interested. Thanks, Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |
From: Kaare R. <ka...@ka...> - 2002-05-27 20:20:46
|
> Does it work with the permissions changes you made? I'm curious about > what would be different for 2.0 + mod_perl. No, Apache 2 + mod_perl 2 won't even start: [Fri May 24 23:34:26 2002] [error] Can't load Perl file: /home/pas/src/startup.pl for server namer.webline.dk:0, exiting... [Mon May 27 21:52:13 2002] [error] Can't locate Org/Bgw/Config.pm in @INC (@INC contains: /src /usr/lib/perl5/5.6.1/i586-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i586-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl .) at /home/pas/src/startup.pl line 5. I guess that PerlSetEnv PAS_BASE "/home/pas" doesn't work in 2.0. I believe there is some sort of compatibility thing, but I haven't had the time to try it out. > Probably the most complex example that comes with Pas is the temperature > converter. It uses a Page object to do the logic, it uses sessions for Why don't you add more elaborate examples? Just a suggestion - it will attact more people. > I'd recommend PostgreSQL if you want an opensource database (that's what I > personaly perfer). PosgreSQL even supports Perl as one of it's procedural Already using PostgreSQL extensively. For Freemoney, it's a requirement. > the database. The more advanced record generator will additionaly generate > methods for insert/update/select/delete. Some kind of binding to a hash or something would be nice. I need the ability to list a lot of rows without too much overhead. The rows need to be listed x at a time. Say I have 1000 customers. I'd like to have an overview of 50, with the ability to page forward, backward, to the top or bottom, and maybe select between the next 20 pages. I think that EmbPerl had a nice idea there, but I'm not sure. This is a demo of Freemoney. User / password is demo / pass: http://www.web-counting.com/cgi-bin/DanskDemo/process/locale/da_DK/freemoney/index.html But I can see that it's not really working. I have to call the manager of that site. Sigh! But the idea is to present a list of customers, products, orders and so on. Be able to sort them in some way. Select one and update/remove it. Or do some other processing. > We usualy develop the business logic in Page objects. You can produce > HTML pages from page objects, but there is no need to. We develop But maybe this functionality will be used in other applications. So it's best to out in modules. Or a combination. > Wether this answers your current questions or not, please ask more > questions. :) There still is a long way, and I'm only looking. My plan is to try Pas for the Freemoney project page. Why don't you use Pas for Pas' own project page? For Freemoney (the Financial App), I need at least Menus (see demo) and Login and Access handling. -- Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 Kaki Data tshirts, merchandize Fax: 3816 2501 Howitzvej 75 Åben 12.00-18.00 Web: www.suse.dk 2000 Frederiksberg Lørdag 11.00-17.00 Email: ka...@ka... |
From: Kyle R . B. <mo...@vo...> - 2002-05-27 19:25:03
|
> Didn't think so - but it had to be tried :-) Does it work with the permissions changes you made? I'm curious about what would be different for 2.0 + mod_perl. > Bingo. #1 was fixed (found it in Apache's error log) but #2 didn't show up in > the log... We need to update the request handler to catch those errors and report them. This is the 2nd person who has run into the problem where Pas is throwing a blank exception. > Time to look into the example suite ;-) Well, do you have some more extensive > examples? Probably the most complex example that comes with Pas is the temperature converter. It uses a Page object to do the logic, it uses sessions for persistient storage (a kind of data layer), and it uses a PSP to do the presentation layer. > I'd like to put some questions here. Hope it's OK. > > For starters, I was searching for an environment that would support the use > og modules in Perl. This is in contrast with embedding tags into html code. With Pas, you can use modules from your PSP pages, or you can use them from your Page objects. In Pas, both PSPs and Page objects end up being objects -- you can use any Perl construct you want to within them. Including developing and using your own stand-alone modules, or any modules from CPAN that you want. The only types of things I woud think wouldn't work would be Tk or other GUI modules. Pas makes use of many CPAN modules itself. You should have an easy time using other modules with Pas. > It can be done, but I think it's dificult in Interchange, and also EmbPerl > and Mason. The natural way to build a Financial Application like Freemoney is > with these layers: > > 1. Database functionality. Constraints, triggers, stored procedures etc. For that, I'd recommend Oracle if you want to use a commercial database. I'd recommend PostgreSQL if you want an opensource database (that's what I personaly perfer). PosgreSQL even supports Perl as one of it's procedural languages. PostgreSQL supports constraints, triggers, stored procedures, and transactions - which are all things that MySQL does not support. Unless you're developing a trivial data model, I'd recommend PostgreSQL over all of the other opensource databases out there. > 2. Database layer in Perl. Insert, update, delete and retrieval. We typicly use a combination of record generation, and factory classes to manage the database. There is a record generator in the codebase now, and we're working on a more flexible version in the current CVS tree. What the generators basicly do is create a Perl object that matches the database table - a get/set member function for each of the columns in the database. The more advanced record generator will additionaly generate methods for insert/update/select/delete. We then typicly build factories for each of the logical areas of the application. The factory is then responsbile for managing the life cycle of the record objects - including optimization of storage/retreival from the database. > 3. Functionality layer in Perl (business rules etc) We usualy develop the business logic in Page objects. You can produce HTML pages from page objects, but there is no need to. We develop the logic in the Page object, and then, once it has performed the appropriate functionality, it places any results into the request, and forwards the request off to a PSP page for presentation. If it were an ecommerce project, and we were talking about a product detail page, then the Page object loads the product from the catalog database, puts it into the request, and forwards the request off to a PSP page that is responsible for displaying a product. Depending on the results, the page object might forward the request off to any one of a number of PSPs for presentation - perhaps one for a successful result, and another for a failure result. > 4. Presentation layer. can access layer 2 and 3. Continuing with the above, the PSPs are then presentation only. A PSP expects specific objects to be present in the request, and is then only responsible for pulling data from them and presenting it as HTML. > How much can pas provide? Probably the last 3. Depending on your precise definition of each of the layers, and how you decided to break your application up. Wether this answers your current questions or not, please ask more questions. :) Thanks again for the discussion. Best regards, Kyle R. Burton -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |