At 02:52 PM 10/5/2001 -0400, Matt Feifarek wrote:
>Is there some way to do this in webkit? I see that the Page.application()
>doesn't have any value-oriented methods.
We certainly intended to make it easy to subclass Application, but haven't
quite achieved that yet.
One easy option would be to make a mix-in:
class AppExtra:
def foo(self):
pass
def bar(self):
pass
from MiscUtils.MixIn import MixIn
from WebKit.Application import Application
MixIn(Application, AppExtras)
To get this going, I guess you could import this module from your Context's
__init__.py
Now you have just added foo() and bar() to the existing Application class.
The single application instance persists for the lifetime of your app
server's lifetime. However, there is only one application total, not one
per context.
Previously, I was Application oriented as well, coming from an environment
that was. However, I have found that I can just as well put my "application
level" data/functions/methods/classes in modules and use those. The benefit
is that each such module stands on its own.
With the application approach you often end up with one class that does 5
separate things, which points you to something monolithic (which makes
reused, debugging, etc. more difficult). On the other hand, you could use
multiple mix-ins like the above and still retain some modularity.
I can certainly see the advantage of having a well known place to grab
commonly used data and services.
Hope that helps.
-Chuck
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss