By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,182 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,182 IT Pros & Developers. It's quick & easy.

Building a GUI agnostic database application

P: n/a
I am wanting to write a database application using Python.

I want it to be GUI agnostic. The GUI will probably be Python/wxPython, but
I would also like the option of a Webbased (PHP?) gui, and possibly GUI's
in Java or C++, Visual Basic etc.

The Python 'backend' may run on the same machine as the client (thick
client), or on the same machine as the database (thin client).

My main requirements are:
1. Reasonably light-weight
2. Secure authentication between the GUI and the backend.
3. Ideally runs wherever Python runs, and at least on Linux, Mac and
Windows.

http://www.markcarter.me.uk/computin...on/python.html has a list of
possible candidates.

These include:
Corba, OSE, SOAP, Spread, Twisted, XML-RPC and Yami

It looks to me like XML-RPC run over SSL is probably the simplest solution,
but I'd be interested in other peoples views.

Thanks,

Rasjid.

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Take at look at PAF http://www.dctools.org

Uwe

Rasjid Wilcox wrote:
I am wanting to write a database application using Python.

I want it to be GUI agnostic. The GUI will probably be Python/wxPython, but
I would also like the option of a Webbased (PHP?) gui, and possibly GUI's
in Java or C++, Visual Basic etc.

The Python 'backend' may run on the same machine as the client (thick
client), or on the same machine as the database (thin client).

My main requirements are:
1. Reasonably light-weight
2. Secure authentication between the GUI and the backend.
3. Ideally runs wherever Python runs, and at least on Linux, Mac and
Windows.

http://www.markcarter.me.uk/computin...on/python.html has a list of
possible candidates.

These include:
Corba, OSE, SOAP, Spread, Twisted, XML-RPC and Yami

It looks to me like XML-RPC run over SSL is probably the simplest solution,
but I'd be interested in other peoples views.

Thanks,

Rasjid.


Jul 18 '05 #2

P: n/a
Uwe Grauer wrote:
Take at look at PAF http://www.dctools.org

Uwe

Rasjid Wilcox wrote:
I am wanting to write a database application using Python.

I want it to be GUI agnostic. The GUI will probably be
Python/wxPython, but
I would also like the option of a Webbased (PHP?) gui, and possibly GUI's
in Java or C++, Visual Basic etc.

The Python 'backend' may run on the same machine as the client (thick
client), or on the same machine as the database (thin client).

My main requirements are:
1. Reasonably light-weight
2. Secure authentication between the GUI and the backend.
3. Ideally runs wherever Python runs, and at least on Linux, Mac and
Windows.


Why not just make a database model that doesn't know anything about the
GUI? The model can a python compliant database driver (say odbc or
whatnot) and you can supply the proper business logic in a concise model.

For example

class model:
def connect(self,...)
def adduser(self,...)
def addPurchase(self,user,item,cosperunit,units):

Now using this database model you can control it with a webbased gui or
a wxPython gui. I don't think that there is a need to use a wire
protocol in this case to attach to your database code which itself uses
a wire protocol to attach to the database. Just consolidate your code
into a model.

This is a typical model->view->controller approach. In my experience
the best way to program this is to write the model first without using a
gui, just a lot of test cases. Once the model does what you want, hook
it up to a gui. This helps to ensure that the model works in at least
two independent environments, the python interactive environment and
also your gui code.

Brian

Jul 18 '05 #3

P: n/a
Uwe Grauer wrote:
Take at look at PAF http://www.dctools.org
Interesting. Should I worry about it only being a 0.1 release? Is it
mostly just a packaging of several existing established components, or is
it something more than that. It does seem to cover pretty much everything
I was thinking about.
Brian Kelley wrote: Why not just make a database model that doesn't know anything about the
GUI? The model can a python compliant database driver (say odbc or
whatnot) and you can supply the proper business logic in a concise model.


This is _precisely_ what I was planning to do.

The issue is that the 'client' program (GUI or text based interface or some
other scripted component or whatever) may or may not be running on the same
machine as the 'business logic' backend component, which may or may not be
on the same machine as the database.

I am aware that there are several frameworks around that resolve this
problem, and am just having trouble working out which to choose. I guess
what I'm really after is some pro's and con's of the alternatives.

I probably did not phrase the original question clearly enough. Although I
understand the concepts, I'm still learning the lingo.

Cheers,

Rasjid.

Jul 18 '05 #4

P: n/a
Rasjid Wilcox wrote:
Why not just make a database model that doesn't know anything about the
GUI? The model can a python compliant database driver (say odbc or
whatnot) and you can supply the proper business logic in a concise model.

This is _precisely_ what I was planning to do.

The issue is that the 'client' program (GUI or text based interface or some
other scripted component or whatever) may or may not be running on the same
machine as the 'business logic' backend component, which may or may not be
on the same machine as the database.

This can still be handled the same way.

Version I

View
^
|
v
Controller <--> Model

Version II

View
^
|
v
Controller <-> (Adapter <-> wire protocol <-> Model)

Now, if the Adapter behaves exactly the same as the oroginal Model you
are in luck and you can replace I with II without ever having to change
the view and the controller.

Of course, this means you will need a good Model to start with the
enables it being used as an Adapter.

A good wire protocol that I have used in the past is pyro
(pyro.sourceforge.net) that almost seamlessly wraps python objects and
can use them remotely. As long as you don't use your model in ways that
pyro can't you can transparently replace the model with the remote calls.

Brian

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.