Advice on OSX cocoa app with Python backend

S

Socheat Sou

After a brief, but informative, discussion on Freenode's #zope
chatroom, I was advised to consult the gurus on c.l.p.

I'm working for a small company who is in desperate need to rewrite it's
15+ year old, flat-file, client-tracking database. The staff uses OSX,
while I administer the couple linux servers we have to run our website
and some internal sites. In our initial brainstorming session, we
decided to go with a Python backend server, handling the database and
business logic, and a native Cocoa application on the client side, with
enough glue to make the two stick.

Also, after a bit of research, I discovered Twisted and PB. I figured
I'd have to write a customized backend to meet our needs. However,
seeing as how 1) I've never written a netwo
rk application before, let alone a multi-threaded application and 2) I'm
the sole developer
on this project, I was looking for as many API's, modules, frameworks,
and/or prebuilt solutions as possible to help me out.

I initially thought of Zope because I had often heard it referred to as
an application serv
er, so I thought it might be something I could use as a basis, write the
business logic, and have the Cocoa application, with some PyObjC,
communicate with the Zope server. We're definately not looking for a
web-based application, so I wasn't quite sure Zope was what I wa
nted.

For those that are interested, we're looking at using MySQL as the DBMS.
From what little I know of OODBMS it doesn't seem like the right choice
because aside from data entry and client record lookups, the biggest use
of the database would be to generate reports and tabulated data on an
arbitrary set of fields. I've read that this isn't exactly the strength
of OODBMS?

We are also looking at a server-client architecture, rather than
individual clients connecting to the database over the network, because
there are some features the staff would like (such as something similar
to message passing between each other, and also being able to administer
connected users).

Does anyone here have any experience building an OSX application with
Python running the show behind the scenes? I hope I didn't come off as
asking "tell me what to do", but rather I would appreciate any advice or
links to resources that might be helpful in this project.

Thanks for your time!
Socheat
 
S

Steve Holden

Socheat said:
After a brief, but informative, discussion on Freenode's #zope
chatroom, I was advised to consult the gurus on c.l.p.

I'm working for a small company who is in desperate need to rewrite it's
15+ year old, flat-file, client-tracking database. The staff uses OSX,
while I administer the couple linux servers we have to run our website
and some internal sites. In our initial brainstorming session, we
decided to go with a Python backend server, handling the database and
business logic, and a native Cocoa application on the client side, with
enough glue to make the two stick.
Sounds like a plan, for a Mac house.
Also, after a bit of research, I discovered Twisted and PB. I figured
I'd have to write a customized backend to meet our needs. However,
seeing as how 1) I've never written a netwo
rk application before, let alone a multi-threaded application and 2) I'm
the sole developer
on this project, I was looking for as many API's, modules, frameworks,
and/or prebuilt solutions as possible to help me out.
First of all, note that Twisted applications needn't be multi-threaded,
as Twisted makes use of asynchronous interfaces. You *can* write
multi-threaded code under Twisted, but you don't have to most of the time.
I initially thought of Zope because I had often heard it referred to as
an application serv
er, so I thought it might be something I could use as a basis, write the
business logic, and have the Cocoa application, with some PyObjC,
communicate with the Zope server. We're definately not looking for a
web-based application, so I wasn't quite sure Zope was what I wa
nted.
It isn't. Much too heavyweight, with much too steep a learning curve for
what appears to be essentially a simple project.
For those that are interested, we're looking at using MySQL as the DBMS.
From what little I know of OODBMS it doesn't seem like the right choice
because aside from data entry and client record lookups, the biggest use
of the database would be to generate reports and tabulated data on an
arbitrary set of fields. I've read that this isn't exactly the strength
of OODBMS?
Who told you that MySQL was OO? It's a bog-standard relational back-end
with transactional capabilities.
We are also looking at a server-client architecture, rather than
individual clients connecting to the database over the network, because
there are some features the staff would like (such as something similar
to message passing between each other, and also being able to administer
connected users).
So you need a(t least one) layer between the database and the client,
which you plan to write in Python. This makes perfect sense. Almost
everything you find about writing servers in Python is going to work for
you, so Google away!
Does anyone here have any experience building an OSX application with
Python running the show behind the scenes? I hope I didn't come off as
asking "tell me what to do", but rather I would appreciate any advice or
links to resources that might be helpful in this project.
Mostly, remember that OSX is effectively just another U**x environment,
so server structures that work under BSD and Linux will tend to work
under OSX. The unique parts of OSX appear (from the outside) to be
Carbon/Cocoa and the funky GUI stuff. So have at it and come back for
advice when you need it. Good luck with your project.

[OBPyCon: of course, if you come to PyCon DC 2005 you can discuss this
stuff with experts:

http://www.python.org/pycon/2005/register.html

The numbers tell us this could be the biggest PyCon ever!]

regards
Steve
 
D

Dennis Lee Bieber

said:
and some internal sites. In our initial brainstorming session, we
decided to go with a Python backend server, handling the database and
business logic, and a native Cocoa application on the client side, with
enough glue to make the two stick.
said:
I initially thought of Zope because I had often heard it referred to as
an application serv
er, so I thought it might be something I could use as a basis, write the
business logic, and have the Cocoa application, with some PyObjC,
communicate with the Zope server. We're definately not looking for a
web-based application, so I wasn't quite sure Zope was what I wa
nted.
Doesn't sound like what you'd want. Zope, CMF, Plone (if you
want the capability progression <G>) appear to be designed to put almost
everything on the server side, with access via a browser.
For those that are interested, we're looking at using MySQL as the DBMS.
From what little I know of OODBMS it doesn't seem like the right choice
because aside from data entry and client record lookups, the biggest use
of the database would be to generate reports and tabulated data on an
arbitrary set of fields. I've read that this isn't exactly the strength
of OODBMS?
<blink><blink> If MySQL is an OO database system, then M$ Jet
originated the concept...

MySQL is still gaining full transactional capability: MyISAM
tables being fast, but not transactional, InnoDB tables supporting
transactions at the trade-off of a slightly slower run time. Okay, they
are adding data types for GIS (?) applications (mapping regions, etc.)
that correlate to some of the types PostgreSQL has had for years -- and
I have seen the latter referred to as an "object-relational" system.
We are also looking at a server-client architecture, rather than
individual clients connecting to the database over the network, because
there are some features the staff would like (such as something similar
to message passing between each other, and also being able to administer
connected users).
Clients connecting to application server that connects to RDBMS?


--
 
S

Socheat Sou

Who told you that MySQL was OO? It's a bog-standard relational back-end
with transactional capabilities.

After re-reading my message, I saw how unclear I was. :) I didn't mean
to say that MySQL was OO. I meant that, we were going to use MySQL as
the RDBMS, but some have suggested looking into OODBMS, like PostgreSQL,
but from what I know of OODBMS they don't seem like the right fit for
this project.

Thanks for the advice guys! So it sounds like I have the general idea
right, but there isn't anything (in the way of already written programs)
that will ease the creation of the backend app. Just get my hands dirty
with the frameworks and write it myself, eh?

Socheat
 
A

Alan Gauld

the RDBMS, but some have suggested looking into OODBMS, like PostgreSQL,
but from what I know of OODBMS they don't seem like the right fit for
this project.

Calling PostGres an OODBMS might be stretching it a wee bit, but
it does have some OO features certainly. However if you are
simply using the DB as persistence in the server and for
reporting then an RDBMS should be fine and the technology is well
understood.

Alan G.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top