On Thu, 2004-09-09 at 06:22, lloyd wrote:
> i'm just getting started with webware, coming out of a java servlet
> environment (tomcat), where the convention is to have a single server
> handle multiple webapps.  

Although either approach is possible, I run separate appserver instances
for each web app.  This allows me to stop/start/upgrade each web app
independently of the others.  This requires that I use a separate port
number for each webserver, but so far this hasn't been a problem.

> with webware, assuming one wants to use a single server instance,
> what is the convention for  a) webapp subdirectories, and  b) individual
> lib directories for each webapp?

I don't know that there is an established convention, but it might make
sense to gather some "best practices" on the wiki, and eventually move this
into the documentation.

> and what about separate lib dirs for each app?  i don't necessarily
> develop each webapp at the same pace - i might need to use version
> 1.5 of my libraries with some, and version 1.6 with others.

If you're running everything in one process, this could be a problem, as
Python has a global path (sys.path).  You could include the version number in the 
library name or path ("lib15", and "lib16"), but then every import statement
would have the version hardcoded, meaning you'd need to update all of those
statements when switching to a new version.  

You could add a level of indirection by doing:

Main.py:
--------

import lib1 as lib

--------

You'd need to define __all__ in the library, so that all submodules are
available just by importing "lib1". 

lib1/__init__.py
----------------

import foo

__all__ = [foo]

----------------

and then within one webapp always using Main.py file to get access to the 
lib.  From other files in the webapp it'd look like:

> import Main
> print Main.lib.foo
<module 'lib1.foo' from 'lib1/foo.pyc'>


This would probably work fine, but my overall recommendation would
be to use a separate appserver for each app -- I think you would run into
fewer complications.

peace,
Jason
server 




> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss

> !DSPAM:41403d2734701197875308!

--
Jason D. Hildebrand
T: 204 775 1212
E: [EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to